Skip to content

Commit 5d54ea0

Browse files
committed
Fix test: check ID > 0 instead of hardcoded value
1 parent 0a50c14 commit 5d54ea0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/fiber/019-fiber_getCoroutine.phpt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ $c = spawn(function() {
1616

1717
$coro = $f->getCoroutine();
1818
echo "Has coroutine: " . ($coro !== null ? "yes" : "no") . "\n";
19-
echo "Coroutine ID: " . $coro->getId() . "\n";
19+
echo "Has ID: " . ($coro->getId() > 0 ? "yes" : "no") . "\n";
2020
echo "Is started: " . ($coro->isStarted() ? "yes" : "no") . "\n";
2121
echo "Is suspended: " . ($coro->isSuspended() ? "yes" : "no") . "\n";
2222

@@ -33,16 +33,16 @@ $f = new Fiber(function() {
3333
$f->start();
3434

3535
$coro = $f->getCoroutine();
36-
echo "Regular fiber coroutine: " . ($coro === null ? "null" : "not-null") . "\n";
36+
echo "Regular fiber: " . ($coro === null ? "null" : "not-null") . "\n";
3737

3838
$f->resume();
3939

4040
echo "OK\n";
4141
?>
4242
--EXPECT--
4343
Has coroutine: yes
44-
Coroutine ID: 2
44+
Has ID: yes
4545
Is started: yes
4646
Is suspended: yes
47-
Regular fiber coroutine: null
47+
Regular fiber: null
4848
OK

0 commit comments

Comments
 (0)