You are here

public function RejectedPromiseTest::testInvokesOnRejectedAsynchronously in Zircon Profile 8

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

File

vendor/guzzlehttp/promises/tests/RejectedPromiseTest.php, line 84

Class

RejectedPromiseTest
@covers GuzzleHttp\Promise\RejectedPromise

Namespace

GuzzleHttp\Promise\Tests

Code

public function testInvokesOnRejectedAsynchronously() {
  $p = new RejectedPromise('a');
  $r = null;
  $f = function ($reason) use (&$r) {
    $r = $reason;
  };
  $p
    ->then(null, $f);
  $this
    ->assertNull($r);
  \GuzzleHttp\Promise\queue()
    ->run();
  $this
    ->assertEquals('a', $r);
}