| Conditions | 3 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function testNoAccessFile() |
||
| 35 | { |
||
| 36 | // existed file without write access for current user. |
||
| 37 | // for Ubuntu is /etc/hosts. |
||
| 38 | $file_name = '/etc/hosts'; |
||
| 39 | |||
| 40 | if (!file_exists($file_name)) { |
||
| 41 | self::markTestSkipped('test only for *nix.'); |
||
| 42 | } |
||
| 43 | |||
| 44 | if (is_writable($file_name)) { |
||
| 45 | self::markTestSkipped('test runned under super/admin user. Change user.'); |
||
| 46 | } |
||
| 47 | |||
| 48 | $this->expectException(OpenFileFail::class); |
||
| 49 | DenyMultiplyRun::setPidFile($file_name); |
||
| 50 | } |
||
| 52 |