<?php namespace React\Tests\EventLoop\Timer; use React\Tests\EventLoop\TestCase; use React\EventLoop\Timer\Timer; use React\EventLoop\Timer\Timers; class TimersTest extends TestCase { public function testBlockedTimer() { $timers = new Timers(); $timers->tick(); // simulate a bunch of processing on stream events, // part of which schedules a future timer... sleep(1); $timers->add(new Timer(0.5, function () { $this->fail("Timer shouldn't be called"); })); $timers->tick(); $this->assertTrue(true); } public function testContains() { $timers = new Timers(); $timer1 = new Timer(0.1, function () {}); $timer2 = new Timer(0.1, function () {}); $timers->add($timer1); self::assertTrue($timers->contains($timer1)); self::assertFalse($timers->contains($timer2)); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
AbstractTimerTest.php | File | 4.18 KB | 0644 |
|
ExtEvTimerTest.php | File | 363 B | 0644 |
|
ExtEventTimerTest.php | File | 368 B | 0644 |
|
ExtLibevTimerTest.php | File | 370 B | 0644 |
|
ExtLibeventTimerTest.php | File | 387 B | 0644 |
|
ExtUvTimerTest.php | File | 354 B | 0644 |
|
StreamSelectTimerTest.php | File | 228 B | 0644 |
|
TimersTest.php | File | 929 B | 0644 |
|