public function FulfilledPromiseTest::testReturnsNewRejectedWhenOnFulfilledFails in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/guzzlehttp/promises/tests/FulfilledPromiseTest.php \GuzzleHttp\Tests\Promise\FulfilledPromiseTest::testReturnsNewRejectedWhenOnFulfilledFails()
File
- vendor/
guzzlehttp/ promises/ tests/ FulfilledPromiseTest.php, line 79
Class
Namespace
GuzzleHttp\Tests\PromiseCode
public function testReturnsNewRejectedWhenOnFulfilledFails() {
$p = new FulfilledPromise('a');
$f = function () {
throw new \Exception('b');
};
$p2 = $p
->then($f);
$this
->assertNotSame($p, $p2);
try {
$p2
->wait();
$this
->fail();
} catch (\Exception $e) {
$this
->assertEquals('b', $e
->getMessage());
}
}