close Warning: AdminModule failed with TracError: Unable to instantiate component <class 'trac.admin.web_ui.LoggingAdminPanel'> (super(type, obj): obj (type LoggingAdminPanel) is not an instance or subtype of type (Markup).)

source: externals/php/vendor/guzzlehttp/promises/tests/TaskQueueTest.php@ 1c92d58

Last change on this file since 1c92d58 was 01a620f, checked in by Joachim Langenbach <joachim.langenbach@…>, 11 years ago

Removed submodules for php externals and use composer to provide them and versioned them afterwards

  • Property mode set to 100644
File size: 826 bytes
Line 
1<?php
2namespace GuzzleHttp\Promise\Test;
3
4use GuzzleHttp\Promise\TaskQueue;
5
6class TaskQueueTest extends \PHPUnit_Framework_TestCase
7{
8 public function testKnowsIfEmpty()
9 {
10 $tq = new TaskQueue(false);
11 $this->assertTrue($tq->isEmpty());
12 }
13
14 public function testKnowsIfFull()
15 {
16 $tq = new TaskQueue(false);
17 $tq->add(function () {});
18 $this->assertFalse($tq->isEmpty());
19 }
20
21 public function testExecutesTasksInOrder()
22 {
23 $tq = new TaskQueue(false);
24 $called = [];
25 $tq->add(function () use (&$called) { $called[] = 'a'; });
26 $tq->add(function () use (&$called) { $called[] = 'b'; });
27 $tq->add(function () use (&$called) { $called[] = 'c'; });
28 $tq->run();
29 $this->assertEquals(['a', 'b', 'c'], $called);
30 }
31}
Note: See TracBrowser for help on using the repository browser.