19 declare(strict_types=1);
    30     private const TEST_STRING_1 = 
"I am a test string for the title capitalization and I hope that works even if it is complicated :)";
    40     protected function setUp(): void
    44         $language = $this->createMock(
ILIAS\Language\Language::class);
    46         $this->f = 
new Refinery($dataFactory, $language);
    47         $this->case_of_label_if_possible = $this->f->string()->caseOfLabel(self::LANGUAGE_KEY);
    53         $this->case_of_label_if_possible = null;
    58         $str = $this->case_of_label_if_possible->transform(self::TEST_STRING_1);
    60         $this->assertEquals(self::EXPECTED_RESULT_TEST_STRING_1, $str);
    65         $str = $this->case_of_label_if_possible->transform(self::TEST_STRING_2);
    67         $this->assertEquals(self::EXPECTED_RESULT_TEST_STRING_2, $str);
    73         $str = $this->case_of_label_if_possible->transform(self::TEST_STRING_3);
    75         $this->assertEquals(self::EXPECTED_RESULT_TEST_STRING_3, $str);
    83             $next_str = $this->case_of_label_if_possible->transform($arr);
    87         $this->assertTrue($raised);
    92             $next_str = $this->case_of_label_if_possible->transform($int);
    96         $this->assertTrue($raised);
   101             $next_str = $this->case_of_label_if_possible->transform($std_class);
   105         $this->assertTrue($raised);
   110         $this->case_of_label_if_possible = $this->f->string()->caseOfLabel(self::LANGUAGE_KEY);
   114         $this->assertEquals(self::EXPECTED_RESULT_TEST_STRING_1, $str);
   119         $this->case_of_label_if_possible = $this->f->string()->caseOfLabel(self::LANGUAGE_KEY);
   128         $this->assertTrue($raised);
   137         $this->assertTrue($raised);
   146         $this->assertTrue($raised);
   153         $valueObject = $factory->ok(self::TEST_STRING_1);
   155         $resultObject = $this->case_of_label_if_possible->applyTo($valueObject);
   157         $this->assertEquals(self::EXPECTED_RESULT_TEST_STRING_1, $resultObject->value());
   158         $this->assertFalse($resultObject->isError());
   165         $valueObject = $factory->ok(42);
   167         $resultObject = $this->case_of_label_if_possible->applyTo($valueObject);
   169         $this->assertTrue($resultObject->isError());
   174         $this->case_of_label_if_possible = $this->f->string()->caseOfLabel(self::SENSELESS_LANGUAGE_KEY);
   178             $str = $this->case_of_label_if_possible->transform(self::TEST_STRING_1);
   182         $this->assertTrue($raised);
 const EXPECTED_RESULT_TEST_STRING_2
 
testApplyToWithValidValueReturnsAnOkResult()
 
const EXPECTED_RESULT_TEST_STRING_3
 
Interface Observer  Contains several chained tasks and infos about them. 
 
const SENSELESS_LANGUAGE_KEY
 
testApplyToWithInvalidValueWillLeadToErrorResult()
 
const EXPECTED_RESULT_TEST_STRING_1
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
Transformation $case_of_label_if_possible