You are here

public function PromiseTest::testThrowsWhenUnwrapIsRejectedWithException in Zircon Profile 8

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

@expectedException \UnexpectedValueException @expectedExceptionMessage foo

File

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

Class

PromiseTest
@covers GuzzleHttp\Promise\Promise

Namespace

GuzzleHttp\Promise\Tests

Code

public function testThrowsWhenUnwrapIsRejectedWithException() {
  $e = new \UnexpectedValueException('foo');
  $p = new Promise(function () use (&$p, $e) {
    $p
      ->reject($e);
  });
  $p
    ->wait();
}