You are here

public function TaskQueueTest::testExecutesTasksInOrder in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/guzzlehttp/promises/tests/TaskQueueTest.php \GuzzleHttp\Promise\Test\TaskQueueTest::testExecutesTasksInOrder()

File

vendor/guzzlehttp/promises/tests/TaskQueueTest.php, line 21

Class

TaskQueueTest

Namespace

GuzzleHttp\Promise\Test

Code

public function testExecutesTasksInOrder() {
  $tq = new TaskQueue(false);
  $called = [];
  $tq
    ->add(function () use (&$called) {
    $called[] = 'a';
  });
  $tq
    ->add(function () use (&$called) {
    $called[] = 'b';
  });
  $tq
    ->add(function () use (&$called) {
    $called[] = 'c';
  });
  $tq
    ->run();
  $this
    ->assertEquals([
    'a',
    'b',
    'c',
  ], $called);
}