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