public function FunctionsTest::testRejectsParentExceptionWhenException in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/guzzlehttp/promises/tests/functionsTest.php \GuzzleHttp\Promise\Tests\FunctionsTest::testRejectsParentExceptionWhenException()
File
- vendor/
guzzlehttp/ promises/ tests/ functionsTest.php, line 361
Class
Namespace
GuzzleHttp\Promise\TestsCode
public function testRejectsParentExceptionWhenException() {
$promise = P\coroutine(function () {
(yield new P\FulfilledPromise(0));
throw new \Exception('a');
});
$promise
->then(function () {
$this
->fail();
}, function ($reason) use (&$result) {
$result = $reason;
});
P\queue()
->run();
$this
->assertInstanceOf('Exception', $result);
$this
->assertEquals('a', $result
->getMessage());
}