Total Complexity | 3 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class TextTest extends TestCase |
||
12 | { |
||
13 | public const CONTENT_STUB = <<<EOT |
||
14 | Tigr, tiger, burning страх. |
||
15 | In theforests of the night, |
||
16 | What imortal hand or eey |
||
17 | CCould frame thy fearful symmetry? |
||
18 | EOT; |
||
19 | |||
20 | public function testContextOverridingMerge(): void |
||
21 | { |
||
22 | $text = Text::utf8('test', ['idx' => '1'])->mergeContext(['idx' => 'foo', 'idx2' => '2']); |
||
23 | |||
24 | $this->assertEquals(Text::utf8('test', ['idx' => 'foo', 'idx2' => '2']), $text); |
||
25 | } |
||
26 | |||
27 | public function testContextNonOverridingMerge(): void |
||
28 | { |
||
29 | $text = Text::utf8('test', ['idx' => '1'])->mergeContext(['idx' => 'foo', 'idx2' => '2'], false); |
||
30 | |||
31 | $this->assertEquals(Text::utf8('test', ['idx' => '1', 'idx2' => '2']), $text); |
||
32 | } |
||
33 | |||
34 | public function testExceptionWhenMergingEmptyContext(): void |
||
35 | { |
||
36 | $this->expectException(InvalidArgumentException::class); |
||
37 | Text::utf8('test', ['idx' => '1'])->mergeContext([]); |
||
38 | } |
||
40 |