Total Complexity | 3 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | trait PHPUnitAssertTrait |
||
8 | { |
||
9 | 12 | public function assertEqualStringsIgnoringLineEndings( |
|
10 | string $expected, |
||
11 | string $actual, |
||
12 | string $message = '' |
||
13 | ): void { |
||
14 | 12 | $expected = self::normalizeLineEndings($expected); |
|
|
|||
15 | 12 | $actual = self::normalizeLineEndings($actual); |
|
16 | |||
17 | 12 | $this->assertEquals($expected, $actual, $message); |
|
18 | 9 | } |
|
19 | |||
20 | 3 | public function assertStringContainsStringIgnoringLineEndings( |
|
21 | string $needle, |
||
22 | string $haystack, |
||
23 | string $message = '' |
||
24 | ): void { |
||
25 | 3 | $needle = self::normalizeLineEndings($needle); |
|
26 | 3 | $haystack = self::normalizeLineEndings($haystack); |
|
27 | |||
28 | 3 | $this->assertStringContainsString($needle, $haystack, $message); |
|
29 | 2 | } |
|
30 | |||
31 | 15 | private function normalizeLineEndings(string $value): string |
|
36 | ]); |
||
37 | } |
||
38 | } |
||
39 |