| Total Complexity | 3 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @throws AuthException |
||
| 13 | */ |
||
| 14 | public function testFiles(): void |
||
| 15 | { |
||
| 16 | $lib = new MockFiles(); |
||
| 17 | $content = $lib->open($this->sourcePath); |
||
| 18 | $this->assertNotEmpty($content); |
||
| 19 | $lib->save($this->testingPath, $content); |
||
| 20 | chmod($this->testingPath, 0444); |
||
| 21 | $this->expectException(AuthException::class); |
||
| 22 | $lib->save($this->testingPath, $content); |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @throws AuthException |
||
| 27 | */ |
||
| 28 | public function testFilesOpenCrash(): void |
||
| 29 | { |
||
| 30 | $lib = new MockFiles(new XCrashStorage()); |
||
| 31 | $this->expectException(AuthException::class); |
||
| 32 | $lib->open($this->testingPath); |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @throws AuthException |
||
| 37 | */ |
||
| 38 | public function testFilesCloseCrash(): void |
||
| 39 | { |
||
| 40 | $lib = new MockFiles(new XCrashStorage()); |
||
| 41 | $this->expectException(AuthException::class); |
||
| 42 | $lib->save($this->testingPath, [['anything']]); |
||
| 43 | } |
||
| 44 | } |
||
| 45 |