Skip to content

Commit e1dd1dd

Browse files
committed
Fix createCallback() return type
MockObject is wrapped in a closure now.
1 parent 2a94112 commit e1dd1dd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/AsyncTestCase.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Amp\DeferredFuture;
66
use Amp\Future;
77
use PHPUnit\Framework\AssertionFailedError;
8-
use PHPUnit\Framework\MockObject\MockObject;
98
use PHPUnit\Framework\TestCase as PHPUnitTestCase;
109
use Revolt\EventLoop;
1110
use Revolt\EventLoop\Driver\TracingDriver;
@@ -193,9 +192,9 @@ final protected function setTimeout(float $seconds): void
193192
* @param int $invocationCount Number of times the callback must be invoked or the test will fail.
194193
* @param callable|null $returnCallback Callable providing a return value for the callback.
195194
*
196-
* @return \Closure&MockObject Mock object having only an __invoke method.
195+
* @return \Closure
197196
*/
198-
final protected function createCallback(int $invocationCount, callable $returnCallback = null): \Closure
197+
final protected function createCallback(int $invocationCount, ?callable $returnCallback = null): \Closure
199198
{
200199
$mock = $this->createMock(CallbackStub::class);
201200
$invocationMocker = $mock->expects(self::exactly($invocationCount))

0 commit comments

Comments
 (0)