public function PromiseTest::testGetsActualWaitValueFromThen in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/guzzlehttp/promises/tests/PromiseTest.php \GuzzleHttp\Promise\Tests\PromiseTest::testGetsActualWaitValueFromThen()
File
- vendor/
guzzlehttp/ promises/ tests/ PromiseTest.php, line 152
Class
Namespace
GuzzleHttp\Promise\TestsCode
public function testGetsActualWaitValueFromThen() {
$p = new Promise(function () use (&$p) {
$p
->reject('Foo!');
});
$p2 = $p
->then(null, function ($reason) {
return new RejectedPromise([
$reason,
]);
});
try {
$p2
->wait();
$this
->fail('Should have thrown');
} catch (RejectionException $e) {
$this
->assertEquals([
'Foo!',
], $e
->getReason());
}
}