Skip to content
This repository was archived by the owner on Feb 6, 2019. It is now read-only.

Commit ee34fb4

Browse files
committed
(test) fixed testing
1 parent 3cbe936 commit ee34fb4

File tree

1 file changed

+7
-35
lines changed

1 file changed

+7
-35
lines changed

tests/unit/ForkTest.php

+7-35
Original file line numberDiff line numberDiff line change
@@ -31,49 +31,21 @@ public function testProcessCheckSuccessNegative()
3131
$this->assertFalse(checkSuccess(null));
3232
}
3333

34-
public function testProcessCheckFailNegative()
35-
{
36-
$pid = forkTask(function () {
37-
usleep(1);
38-
});
39-
40-
sleep(1);
41-
$this->assertFalse(checkFail(null));
42-
$this->assertFalse(checkFail($pid));
43-
}
44-
45-
public function testProcessCheckAvailablePositive()
46-
{
47-
$pid = forkTask(function () {
48-
usleep(1);
49-
});
50-
51-
if ($pid !== null) {
52-
$this->assertTrue(checkAvailable($pid));
53-
}
54-
}
55-
56-
public function testProcessCheckAvailableNegative()
57-
{
58-
$this->assertFalse(checkAvailable(null));
59-
}
60-
61-
public function checkCloseForkPositive()
34+
public function testCheckCloseForkPositive()
6235
{
6336
$pid = forkTask(function () {
6437
sleep(2);
6538
});
6639

67-
$return = closeTask($pid);
68-
69-
$this->assertFalse(checkAvailable($pid));
70-
$this->assertTrue($return);
40+
if ($pid !== null) {
41+
$return = closeTask($pid);
42+
$this->assertTrue($return);
43+
}
7144
}
7245

73-
public function checkCloseForkNegative()
46+
public function testCheckCloseForkNegative()
7447
{
75-
$return = closeTask(99999999999999999999999999);
76-
48+
$return = closeTask(999999);
7749
$this->assertFalse($return);
7850
}
7951
}

0 commit comments

Comments
 (0)