27 protected function setUp() : void
29 $language = $this->createMock(\ilLanguage::class);
32 $this->custom = $this->f->custom()->transformation(
34 if (!is_string($value)) {
50 $result = $this->custom->transform(self::TEST_STRING);
51 $this->assertEquals(self::TEST_STRING,
$result);
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);
87 $custom = $this->f->custom()->transformation(
89 if (!is_string($value)) {
97 $this->assertEquals(self::TEST_STRING,
$result);
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);
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());
Class ChatMainBarProvider .