You are here

public function PromiseTest::testCancelsPromiseWithCancelFunction in Zircon Profile 8

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

File

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

Class

PromiseTest
@covers GuzzleHttp\Promise\Promise

Namespace

GuzzleHttp\Promise\Tests

Code

public function testCancelsPromiseWithCancelFunction() {
  $called = false;
  $p = new Promise(null, function () use (&$called) {
    $called = true;
  });
  $p
    ->cancel();
  $this
    ->assertEquals('rejected', $p
    ->getState());
  $this
    ->assertTrue($called);
}