You are here

public function FunctionsTest::testCanScheduleThunk in Zircon Profile 8

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

File

vendor/guzzlehttp/promises/tests/functionsTest.php, line 303

Class

FunctionsTest

Namespace

GuzzleHttp\Promise\Tests

Code

public function testCanScheduleThunk() {
  $tramp = P\queue();
  $promise = P\task(function () {
    return 'Hi!';
  });
  $c = null;
  $promise
    ->then(function ($v) use (&$c) {
    $c = $v;
  });
  $this
    ->assertNull($c);
  $tramp
    ->run();
  $this
    ->assertEquals('Hi!', $c);
}