Class CaseOfLabelTest.
More...
◆ setUp()
CaseOfLabelTest::setUp |
( |
| ) |
|
|
protected |
Definition at line 38 of file CaseOfLabelTest.php.
40 $dataFactory =
new Data\Factory();
42 $language = $this->createMock(
'\\' . ilLanguage::class);
44 $this->f =
new Refinery\Factory($dataFactory, $language);
45 $this->case_of_label_if_possible = $this->f->string()->caseOfLabel(self::LANGUAGE_KEY);
◆ tearDown()
CaseOfLabelTest::tearDown |
( |
| ) |
|
|
protected |
◆ testApplyToWithInvalidValueWillLeadToErrorResult()
CaseOfLabelTest::testApplyToWithInvalidValueWillLeadToErrorResult |
( |
| ) |
|
Definition at line 194 of file CaseOfLabelTest.php.
References $factory.
200 $resultObject = $this->case_of_label_if_possible->applyTo($valueObject);
202 $this->assertTrue($resultObject->isError());
◆ testApplyToWithValidValueReturnsAnOkResult()
CaseOfLabelTest::testApplyToWithValidValueReturnsAnOkResult |
( |
| ) |
|
Definition at line 178 of file CaseOfLabelTest.php.
References $factory.
182 $valueObject =
$factory->ok(self::TEST_STRING_1);
184 $resultObject = $this->case_of_label_if_possible->applyTo($valueObject);
186 $this->assertEquals(self::EXPECTED_RESULT_TEST_STRING_1, $resultObject->value());
187 $this->assertFalse($resultObject->isError());
◆ testInvoke()
CaseOfLabelTest::testInvoke |
( |
| ) |
|
Definition at line 129 of file CaseOfLabelTest.php.
References $case_of_label_if_possible.
131 $this->case_of_label_if_possible = $this->f->string()->caseOfLabel(self::LANGUAGE_KEY);
135 $this->assertEquals(self::EXPECTED_RESULT_TEST_STRING_1, $str);
$case_of_label_if_possible
◆ testInvokeFails()
CaseOfLabelTest::testInvokeFails |
( |
| ) |
|
Definition at line 142 of file CaseOfLabelTest.php.
References $case_of_label_if_possible, and Vendor\Package\$e.
144 $this->case_of_label_if_possible = $this->f->string()->caseOfLabel(self::LANGUAGE_KEY);
153 $this->assertTrue($raised);
162 $this->assertTrue($raised);
166 $std_class =
new stdClass();
171 $this->assertTrue($raised);
$case_of_label_if_possible
◆ testTransform1()
CaseOfLabelTest::testTransform1 |
( |
| ) |
|
Definition at line 62 of file CaseOfLabelTest.php.
64 $str = $this->case_of_label_if_possible->transform(self::TEST_STRING_1);
66 $this->assertEquals(self::EXPECTED_RESULT_TEST_STRING_1, $str);
◆ testTransform2()
CaseOfLabelTest::testTransform2 |
( |
| ) |
|
Definition at line 73 of file CaseOfLabelTest.php.
75 $str = $this->case_of_label_if_possible->transform(self::TEST_STRING_2);
77 $this->assertEquals(self::EXPECTED_RESULT_TEST_STRING_2, $str);
◆ testTransform3()
CaseOfLabelTest::testTransform3 |
( |
| ) |
|
Definition at line 84 of file CaseOfLabelTest.php.
86 $str = $this->case_of_label_if_possible->transform(self::TEST_STRING_3);
88 $this->assertEquals(self::EXPECTED_RESULT_TEST_STRING_3, $str);
◆ testTransformFails()
CaseOfLabelTest::testTransformFails |
( |
| ) |
|
Definition at line 95 of file CaseOfLabelTest.php.
References Vendor\Package\$e.
100 $next_str = $this->case_of_label_if_possible->transform($arr);
104 $this->assertTrue($raised);
109 $next_str = $this->case_of_label_if_possible->transform($int);
113 $this->assertTrue($raised);
117 $std_class =
new stdClass();
118 $next_str = $this->case_of_label_if_possible->transform($std_class);
122 $this->assertTrue($raised);
◆ testUnknownLanguageKey()
CaseOfLabelTest::testUnknownLanguageKey |
( |
| ) |
|
Definition at line 209 of file CaseOfLabelTest.php.
References Vendor\Package\$e.
211 $this->case_of_label_if_possible = $this->f->string()->caseOfLabel(self::SENSELESS_LANGUAGE_KEY);
215 $str = $this->case_of_label_if_possible->transform(self::TEST_STRING_1);
219 $this->assertTrue($raised);
◆ $case_of_label_if_possible
CaseOfLabelTest::$case_of_label_if_possible |
|
protected |
◆ $f
◆ EXPECTED_RESULT_TEST_STRING_1
const CaseOfLabelTest::EXPECTED_RESULT_TEST_STRING_1 = "I Am a Test String for the Title Capitalization and I Hope that Works even if It Is Complicated :)" |
◆ EXPECTED_RESULT_TEST_STRING_2
const CaseOfLabelTest::EXPECTED_RESULT_TEST_STRING_2 = "I Switch the Computer on and Go Online" |
◆ EXPECTED_RESULT_TEST_STRING_3
const CaseOfLabelTest::EXPECTED_RESULT_TEST_STRING_3 = "Now It Is Working" |
◆ LANGUAGE_KEY
const CaseOfLabelTest::LANGUAGE_KEY = "en" |
◆ SENSELESS_LANGUAGE_KEY
const CaseOfLabelTest::SENSELESS_LANGUAGE_KEY = "this_language_key_will_never_exist" |
◆ TEST_STRING_1
const CaseOfLabelTest::TEST_STRING_1 = "I am a test string for the title capitalization and I hope that works even if it is complicated :)" |
◆ TEST_STRING_2
const CaseOfLabelTest::TEST_STRING_2 = "I switch the computer on and go online" |
◆ TEST_STRING_3
const CaseOfLabelTest::TEST_STRING_3 = "Now it is working" |
The documentation for this class was generated from the following file: