public function PromiseTest::testRejectsPromiseWhenCancelFails in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/guzzlehttp/promises/tests/PromiseTest.php \GuzzleHttp\Promise\Tests\PromiseTest::testRejectsPromiseWhenCancelFails()
File
- vendor/
guzzlehttp/ promises/ tests/ PromiseTest.php, line 252
Class
Namespace
GuzzleHttp\Promise\TestsCode
public function testRejectsPromiseWhenCancelFails() {
$called = false;
$p = new Promise(null, function () use (&$called) {
$called = true;
throw new \Exception('e');
});
$p
->cancel();
$this
->assertEquals('rejected', $p
->getState());
$this
->assertTrue($called);
try {
$p
->wait();
$this
->fail();
} catch (\Exception $e) {
$this
->assertEquals('e', $e
->getMessage());
}
}