public function RejectedPromiseTest::testThrowsReasonWhenWaitedUpon in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/guzzlehttp/promises/tests/RejectedPromiseTest.php \GuzzleHttp\Promise\Tests\RejectedPromiseTest::testThrowsReasonWhenWaitedUpon()
File
- vendor/
guzzlehttp/ promises/ tests/ RejectedPromiseTest.php, line 12
Class
Namespace
GuzzleHttp\Promise\TestsCode
public function testThrowsReasonWhenWaitedUpon() {
$p = new RejectedPromise('foo');
$this
->assertEquals('rejected', $p
->getState());
try {
$p
->wait(true);
$this
->fail();
} catch (\Exception $e) {
$this
->assertEquals('rejected', $p
->getState());
$this
->assertContains('foo', $e
->getMessage());
}
}