Skip to content

Commit

Permalink
Fix rename leftovers
Browse files Browse the repository at this point in the history
  • Loading branch information
kelunik committed Dec 3, 2021
1 parent d94a1a5 commit 521624b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions test/Cancellation/TimeoutCancellationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand All @@ -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"]);
}
}
8 changes: 4 additions & 4 deletions test/Future/FutureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 521624b

Please sign in to comment.