TestCase for Custom transformations.
More...
◆ setUp()
TransformationsCustomTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 27 of file TransformationsCustomTest.php.
29 $language = $this->createMock(\ilLanguage::class);
32 $this->custom = $this->f->custom()->transformation(
34 if (!is_string($value)) {
Class ChatMainBarProvider .
◆ tearDown()
TransformationsCustomTest::tearDown |
( |
| ) |
|
|
protected |
◆ testApplyToWithValidValueReturnsAnOkResult()
TransformationsCustomTest::testApplyToWithValidValueReturnsAnOkResult |
( |
| ) |
|
Definition at line 140 of file TransformationsCustomTest.php.
References $factory.
142 $factory = new \ILIAS\Data\Factory();
143 $valueObject =
$factory->ok(self::TEST_STRING);
145 $resultObject = $this->custom->applyTo($valueObject);
147 $this->assertEquals(self::TEST_STRING, $resultObject->value());
148 $this->assertFalse($resultObject->isError());
◆ testInvoke()
TransformationsCustomTest::testInvoke |
( |
| ) |
|
◆ testInvokeFails()
TransformationsCustomTest::testInvokeFails |
( |
| ) |
|
Definition at line 100 of file TransformationsCustomTest.php.
References $custom, and Vendor\Package\$e.
102 $custom = $this->f->custom()->transformation(
104 if (!is_string($value)) {
113 $lower_string =
$custom(array());
115 $this->assertEquals(
"'array' is not a string.", $e->getMessage());
118 $this->assertTrue($raised);
122 $lower_string =
$custom(12345);
124 $this->assertEquals(
"'integer' is not a string.", $e->getMessage());
127 $this->assertTrue($raised);
132 $lower_string =
$custom($std_class);
134 $this->assertEquals(
"'object' is not a string.", $e->getMessage());
137 $this->assertTrue($raised);
◆ testTransform()
TransformationsCustomTest::testTransform |
( |
| ) |
|
◆ testTransformFails()
TransformationsCustomTest::testTransformFails |
( |
| ) |
|
Definition at line 54 of file TransformationsCustomTest.php.
References Vendor\Package\$e.
58 $lower_string = $this->custom->transform(array());
60 $this->assertEquals(
"'array' is not a string.", $e->getMessage());
63 $this->assertTrue($raised);
67 $lower_string = $this->custom->transform(12345);
69 $this->assertEquals(
"'integer' is not a string.", $e->getMessage());
72 $this->assertTrue($raised);
77 $lower_string = $this->custom->transform($std_class);
79 $this->assertEquals(
"'object' is not a string.", $e->getMessage());
82 $this->assertTrue($raised);
◆ $custom
TransformationsCustomTest::$custom |
|
private |
◆ $f
TransformationsCustomTest::$f |
|
private |
◆ TEST_STRING
const TransformationsCustomTest::TEST_STRING = "Test" |
The documentation for this class was generated from the following file: