◆ assertDoesNotThrow()
ilCertificateBaseTestCase::assertDoesNotThrow |
( |
callable |
$cb, |
|
|
string |
$message = '' |
|
) |
| |
|
protected |
- Parameters
-
Definition at line 55 of file ilCertificateBaseTestCase.php.
55 : void
56 {
57 try {
58 $cb();
59 $this->addToAssertionCount(1);
60 }
catch (Throwable
$e) {
61 $this->fail(
63 '(unexpected %s: %s)' . PHP_EOL . '%s',
66 $e->getTraceAsString()
67 ))
68 );
69 }
70 }
References Vendor\Package\$e, and $message.
◆ assertThrows()
ilCertificateBaseTestCase::assertThrows |
( |
callable |
$cb, |
|
|
?string |
$expected_class = null , |
|
|
?string |
$expected_message = null |
|
) |
| |
|
protected |
@template T of Throwable
- Parameters
-
callable | $cb | |
| class-string<T>|null | $expected_class |
string | null | $expected_message | |
Definition at line 78 of file ilCertificateBaseTestCase.php.
82 : void {
83 try {
84 $cb();
85 $this->fail(sprintf(
86 'Failed asserting that exception %s was thrown.',
87 $expected_class ?? '(any exception)'
88 ));
89 }
catch (Throwable
$e) {
90 if ($expected_class !==
null && !
$e instanceof $expected_class) {
91 $this->fail(sprintf(
92 'Failed asserting exception of type %s. Got %s instead.',
93 $expected_class,
95 ));
96 }
97 if ($expected_message !==
null && !str_contains(
$e->getMessage(), $expected_message)) {
98 $this->fail(sprintf(
99 'Failed asserting exception message contains "%s". Actual message: "%s"',
100 $expected_message,
102 ));
103 }
104 $this->addToAssertionCount(1);
105 }
106 }
◆ setGlobalVariable()
ilCertificateBaseTestCase::setGlobalVariable |
( |
string |
$name, |
|
|
mixed |
$value |
|
) |
| |
|
protected |
◆ setUp()
ilCertificateBaseTestCase::setUp |
( |
| ) |
|
|
protected |
◆ tearDown()
ilCertificateBaseTestCase::tearDown |
( |
| ) |
|
|
protected |
◆ $dic
Definition at line 26 of file ilCertificateBaseTestCase.php.
Referenced by tearDown(), ilCertificateCronTest\testActivation(), ilCertificateCronTest\testFlexibleActivation(), ilCertificateCronTest\testGetDefaultScheduleType(), ilCertificateCronTest\testGetDefaultScheduleValue(), ilCertificateCronTest\testGetDescription(), ilCertificateLearningHistoryProviderTest\testGetEntries(), ilCertificateCronTest\testGetId(), ilCertificateLearningHistoryProviderTest\testGetName(), ilCertificateCronTest\testGetTitle(), and ilCertificateLearningHistoryProviderTest\testIsActive().
The documentation for this class was generated from the following file: