diff --git a/tests/CoroutineTest.php b/tests/CoroutineTest.php index c9b7439..2c674c5 100644 --- a/tests/CoroutineTest.php +++ b/tests/CoroutineTest.php @@ -193,6 +193,8 @@ public function testCoroutineShouldNotCreateAnyGarbageReferencesForPromiseReject }); }); + $promise->then(null, $this->expectCallableOnce()); // avoid reporting unhandled rejection + unset($promise); $this->assertEquals(0, gc_collect_cycles()); @@ -232,6 +234,8 @@ public function testCoroutineShouldNotCreateAnyGarbageReferencesWhenGeneratorThr yield; // @phpstan-ignore-line }); + $promise->then(null, $this->expectCallableOnce()); // avoid reporting unhandled rejection + unset($promise); $this->assertEquals(0, gc_collect_cycles()); @@ -249,6 +253,8 @@ public function testCoroutineShouldNotCreateAnyGarbageReferencesWhenGeneratorYie yield 42; }); + $promise->then(null, $this->expectCallableOnce()); // avoid reporting unhandled rejection + unset($promise); $this->assertEquals(0, gc_collect_cycles());