Skip to content

Commit dd82787

Browse files
committed
Rename Deferred → DeferredFuture
1 parent 88d49c4 commit dd82787

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/AsyncTestCase.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Amp\PHPUnit;
44

5-
use Amp\Deferred;
5+
use Amp\DeferredFuture;
66
use Amp\Future;
77
use PHPUnit\Framework\AssertionFailedError;
88
use PHPUnit\Framework\MockObject\MockObject;
@@ -16,7 +16,7 @@ abstract class AsyncTestCase extends PHPUnitTestCase
1616
{
1717
private const RUNTIME_PRECISION = 2;
1818

19-
private Deferred $deferred;
19+
private DeferredFuture $deferred;
2020

2121
private string $timeoutId;
2222

@@ -49,7 +49,7 @@ protected function setUp(): void
4949
{
5050
$this->setUpInvoked = true;
5151

52-
$this->deferred = new Deferred;
52+
$this->deferred = new DeferredFuture();
5353

5454
EventLoop::setErrorHandler(function (\Throwable $exception): void {
5555
if ($this->deferred->isComplete()) {
@@ -87,14 +87,14 @@ final protected function runAsyncTest(mixed ...$args): mixed
8787

8888
// Force an extra tick of the event loop to ensure any uncaught exceptions are
8989
// forwarded to the event loop handler before the test ends.
90-
$deferred = new Deferred;
91-
EventLoop::defer(static fn () => $deferred->complete(null));
90+
$deferred = new DeferredFuture();
91+
EventLoop::defer(static fn () => $deferred->complete());
9292
$deferred->getFuture()->await();
9393

9494
return $result;
9595
} finally {
9696
if (!$this->deferred->isComplete()) {
97-
$this->deferred->complete(null);
97+
$this->deferred->complete();
9898
}
9999
}
100100
}),
@@ -135,7 +135,7 @@ final protected function runTest(): mixed
135135
/**
136136
* Fails the test if the loop does not run for at least the given amount of time.
137137
*
138-
* @param int $runtime Required run time in seconds.
138+
* @param float $runtime Required run time in seconds.
139139
*/
140140
final protected function setMinimumRuntime(float $runtime): void
141141
{

0 commit comments

Comments
 (0)