You are here

public function RejectedPromiseTest::testOtherwiseIsSugarForRejections in Zircon Profile 8

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

File

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

Class

RejectedPromiseTest
@covers GuzzleHttp\Promise\RejectedPromise

Namespace

GuzzleHttp\Promise\Tests

Code

public function testOtherwiseIsSugarForRejections() {
  $p = new RejectedPromise('foo');
  $p
    ->otherwise(function ($v) use (&$c) {
    $c = $v;
  });
  \GuzzleHttp\Promise\queue()
    ->run();
  $this
    ->assertSame('foo', $c);
}