You are here

public function FunctionsTest::testEachLimitAllRejectsOnFailure in Zircon Profile 8

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

File

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

Class

FunctionsTest

Namespace

GuzzleHttp\Promise\Tests

Code

public function testEachLimitAllRejectsOnFailure() {
  $p = [
    new FulfilledPromise('a'),
    new RejectedPromise('b'),
  ];
  $aggregate = \GuzzleHttp\Promise\each_limit_all($p, 2);
  P\queue()
    ->run();
  $this
    ->assertEquals(P\PromiseInterface::REJECTED, $aggregate
    ->getState());
  $result = \GuzzleHttp\Promise\inspect($aggregate);
  $this
    ->assertEquals('b', $result['reason']);
}