diff --git a/test/Cancellation/TimeoutCancellationTest.php b/test/Cancellation/TimeoutCancellationTest.php index 143ebb1c..75fb299d 100644 --- a/test/Cancellation/TimeoutCancellationTest.php +++ b/test/Cancellation/TimeoutCancellationTest.php @@ -14,14 +14,14 @@ class TimeoutCancellationTest extends AsyncTestCase public function testTimeout(): void { $line = __LINE__ + 1; - $token = new TimeoutCancellation(0.01); + $cancellation = new TimeoutCancellation(0.01); - self::assertFalse($token->isRequested()); + self::assertFalse($cancellation->isRequested()); delay(0.02); - self::assertTrue($token->isRequested()); + self::assertTrue($cancellation->isRequested()); try { - $token->throwIfRequested(); + $cancellation->throwIfRequested(); } catch (CancelledException $exception) { self::assertInstanceOf(TimeoutException::class, $exception->getPrevious()); @@ -37,9 +37,9 @@ public function testTimeout(): void public function testWatcherCancellation(): void { $enabled = EventLoop::getInfo()["delay"]["enabled"]; - $token = new TimeoutCancellation(0.001); + $cancellation = new TimeoutCancellation(0.001); self::assertSame($enabled + 1, EventLoop::getInfo()["delay"]["enabled"]); - unset($token); + unset($cancellation); self::assertSame($enabled, EventLoop::getInfo()["delay"]["enabled"]); } } diff --git a/test/Future/FutureTest.php b/test/Future/FutureTest.php index 482100d2..55d2a92d 100644 --- a/test/Future/FutureTest.php +++ b/test/Future/FutureTest.php @@ -156,20 +156,20 @@ public function testCancellation(): void { $future = $this->delay(0.02, true); - $token = new TimeoutCancellation(0.01); + $cancellation = new TimeoutCancellation(0.01); $this->expectException(CancelledException::class); - $future->await($token); + $future->await($cancellation); } public function testCompleteBeforeCancellation(): void { $future = $this->delay(0.01, true); - $token = new TimeoutCancellation(0.02); + $cancellation = new TimeoutCancellation(0.02); - self::assertTrue($future->await($token)); + self::assertTrue($future->await($cancellation)); } public function testCompleteThenCancelJoin(): void