Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function testExit() |
||
15 | { |
||
16 | $pid = pcntl_fork(); |
||
17 | if ($pid > 0) { |
||
18 | pcntl_wait($status); |
||
19 | $status = new Status($status); |
||
20 | $this->assertTrue($status->isExited()); |
||
21 | $this->assertEquals(2, $status->getExitCode()); |
||
22 | $this->assertNotEmpty($status->getErrorMessage()); |
||
23 | } elseif ($pid == 0) { |
||
24 | usleep(100); |
||
25 | if (!file_exists('/file-not-exists')) { |
||
26 | exit(2); |
||
27 | } |
||
28 | exit; |
||
29 | } |
||
30 | } |
||
31 | |||
74 |