You are here

public function PromiseTest::testThrowsWaitExceptionAfterPromiseIsResolved in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/promises/tests/PromiseTest.php \GuzzleHttp\Promise\Tests\PromiseTest::testThrowsWaitExceptionAfterPromiseIsResolved()

File

vendor/guzzlehttp/promises/tests/PromiseTest.php, line 137

Class

PromiseTest
@covers GuzzleHttp\Promise\Promise

Namespace

GuzzleHttp\Promise\Tests

Code

public function testThrowsWaitExceptionAfterPromiseIsResolved() {
  $p = new Promise(function () use (&$p) {
    $p
      ->reject('Foo!');
    throw new \Exception('Bar?');
  });
  try {
    $p
      ->wait();
    $this
      ->fail();
  } catch (\Exception $e) {
    $this
      ->assertEquals('Bar?', $e
      ->getMessage());
  }
}