You are here

public function FulfilledPromiseTest::testAsynchronouslyInvokesOnFulfilled in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/guzzlehttp/promises/tests/FulfilledPromiseTest.php \GuzzleHttp\Tests\Promise\FulfilledPromiseTest::testAsynchronouslyInvokesOnFulfilled()

File

vendor/guzzlehttp/promises/tests/FulfilledPromiseTest.php, line 67

Class

FulfilledPromiseTest
@covers GuzzleHttp\Promise\FulfilledPromise

Namespace

GuzzleHttp\Tests\Promise

Code

public function testAsynchronouslyInvokesOnFulfilled() {
  $p = new FulfilledPromise('a');
  $r = null;
  $f = function ($d) use (&$r) {
    $r = $d;
  };
  $p2 = $p
    ->then($f);
  $this
    ->assertNotSame($p, $p2);
  $this
    ->assertNull($r);
  \GuzzleHttp\Promise\queue()
    ->run();
  $this
    ->assertEquals('a', $r);
}