Total Complexity | 3 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
13 | class FileTest extends TestCase |
||
14 | { |
||
15 | private const TEXT_FIXTURE_FILE_PATH = __DIR__ . '/../Fixtures/Text/mispelling1.txt'; |
||
16 | |||
17 | public function testToTexts() |
||
18 | { |
||
19 | $texts = (new File(self::TEXT_FIXTURE_FILE_PATH))->toTexts(['ctx' => 'in tests']); |
||
20 | $this->assertEquals( |
||
21 | [ |
||
22 | new Text( |
||
23 | "mispelling1\n", |
||
24 | TextEncoding::ASCII, |
||
25 | [ |
||
26 | 'ctx' => 'in tests', |
||
27 | 'filePath' => realpath(self::TEXT_FIXTURE_FILE_PATH), |
||
28 | ] |
||
29 | ), |
||
30 | ], |
||
31 | $texts |
||
32 | ); |
||
33 | } |
||
34 | |||
35 | public function testInvalidPath() |
||
36 | { |
||
37 | $this->expectException(FilesystemException::class); |
||
38 | (new File('invalidPath'))->toTexts(); |
||
39 | } |
||
40 | |||
41 | public function testToTextsWithEncoding() |
||
56 | ); |
||
57 | } |
||
58 | } |
||
59 |