You are here

public function FunctionsTest::testCanWaitUntilSomeCountIsSatisfied in Zircon Profile 8

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

File

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

Class

FunctionsTest

Namespace

GuzzleHttp\Promise\Tests

Code

public function testCanWaitUntilSomeCountIsSatisfied() {
  $a = new Promise(function () use (&$a) {
    $a
      ->resolve('a');
  });
  $b = new Promise(function () use (&$b) {
    $b
      ->resolve('b');
  });
  $c = new Promise(function () use (&$c) {
    $c
      ->resolve('c');
  });
  $d = \GuzzleHttp\Promise\some(2, [
    $a,
    $b,
    $c,
  ]);
  $this
    ->assertEquals([
    'a',
    'b',
  ], $d
    ->wait());
}