diff --git a/tests/Io/FiberHandlerTest.php b/tests/Io/FiberHandlerTest.php index 6b8d23c..a552a09 100644 --- a/tests/Io/FiberHandlerTest.php +++ b/tests/Io/FiberHandlerTest.php @@ -101,9 +101,15 @@ public function testInvokeWithHandlerReturningGeneratorReturningResponseAfterYie } }); - /** @var \Generator $generator */ - $this->assertInstanceOf(\Generator::class, $generator); - $generator->throw(new \RuntimeException('Foo')); + assert($generator instanceof \Generator); + $promise = $generator->current(); + + assert($promise instanceof PromiseInterface); + $promise->then(null, function (\Throwable $e) use ($generator) { + $generator->throw($e); + }); + + assert(!$generator->valid()); $ret = $generator->getReturn(); $this->assertSame($response, $ret);