You are here

public function EachPromiseTest::testReturnsPromiseForWhatever in Zircon Profile 8

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

File

vendor/guzzlehttp/promises/tests/EachPromiseTest.php, line 208

Class

EachPromiseTest
@covers GuzzleHttp\Promise\EachPromise

Namespace

GuzzleHttp\Promise\Tests

Code

public function testReturnsPromiseForWhatever() {
  $called = [];
  $arr = [
    'a',
    'b',
  ];
  $each = new EachPromise($arr, [
    'fulfilled' => function ($v) use (&$called) {
      $called[] = $v;
    },
  ]);
  $p = $each
    ->promise();
  $this
    ->assertNull($p
    ->wait());
  $this
    ->assertEquals([
    'a',
    'b',
  ], $called);
}