diff --git a/src/utils/tests/ParallelTest.php b/src/utils/tests/ParallelTest.php index 2fbf8976e..c48e46b6e 100644 --- a/src/utils/tests/ParallelTest.php +++ b/src/utils/tests/ParallelTest.php @@ -24,7 +24,6 @@ class ParallelTest extends TestCase { public function testParallel() { - $id = Coroutine::id(); // Closure $parallel = new Parallel(); for ($i = 0; $i < 3; ++$i) { @@ -33,7 +32,8 @@ class ParallelTest extends TestCase }); } $result = $parallel->wait(); - $this->assertSame([$id + 1, $id + 2, $id + 3], $result); + $id = $result[0]; + $this->assertSame([$id, $id + 1, $id + 2], $result); // Array $parallel = new Parallel(); @@ -41,7 +41,8 @@ class ParallelTest extends TestCase $parallel->add([$this, 'returnCoId']); } $result = $parallel->wait(); - $this->assertSame([$id + 4, $id + 5, $id + 6], $result); + $id = $result[0]; + $this->assertSame([$id, $id + 1, $id + 2], $result); } public function returnCoId()