Definition at line 5 of file LoopTest.php.
◆ testAddReadStream()
Sabre\Event\Loop\LoopTest::testAddReadStream |
( |
| ) |
|
Definition at line 100 of file LoopTest.php.
References $h, and $result.
102 $h =
fopen(
'php://temp',
'r+');
103 fwrite(
$h,
'hello world');
110 $loop->addReadStream(
$h,
function() use (
$h, $loop, &
$result) {
113 $loop->removeReadStream(
$h);
117 $this->assertEquals(
'hello world',
$result);
◆ testAddWriteStream()
Sabre\Event\Loop\LoopTest::testAddWriteStream |
( |
| ) |
|
Definition at line 84 of file LoopTest.php.
References $h.
88 $loop->addWriteStream(
$h,
function() use (
$h, $loop) {
90 fwrite(
$h,
'hello world');
91 $loop->removeWriteStream(
$h);
96 $this->assertEquals(
'hello world', stream_get_contents(
$h));
◆ testNextTick()
Sabre\Event\Loop\LoopTest::testNextTick |
( |
| ) |
|
Definition at line 7 of file LoopTest.php.
11 $loop->nextTick(
function() use (&$check) {
19 $this->assertEquals(1, $check);
◆ testNextTickStacking()
Sabre\Event\Loop\LoopTest::testNextTickStacking |
( |
| ) |
|
Here we add a new nextTick function as we're in the middle of a current nextTick.
Definition at line 159 of file LoopTest.php.
163 $loop->nextTick(
function() use (&$check, $loop) {
165 $loop->nextTick(
function() use (&$check) {
176 $this->assertEquals(2, $check);
◆ testSetInterval()
Sabre\Event\Loop\LoopTest::testSetInterval |
( |
| ) |
|
Definition at line 65 of file LoopTest.php.
70 $intervalId = $loop->setInterval(
function() use (&$check, &$intervalId, $loop) {
74 $loop->clearInterval($intervalId);
80 $this->assertEquals(6, $check);
◆ testStop()
Sabre\Event\Loop\LoopTest::testStop |
( |
| ) |
|
Definition at line 121 of file LoopTest.php.
125 $loop->setTimeout(
function() use (&$check) {
129 $loop->nextTick(
function() use ($loop) {
134 $this->assertEquals(0, $check);
◆ testTick()
Sabre\Event\Loop\LoopTest::testTick |
( |
| ) |
|
Definition at line 138 of file LoopTest.php.
142 $loop->setTimeout(
function() use (&$check) {
146 $loop->nextTick(
function() use ($loop, &$check) {
151 $this->assertEquals(1, $check);
◆ testTimeout()
Sabre\Event\Loop\LoopTest::testTimeout |
( |
| ) |
|
Definition at line 23 of file LoopTest.php.
27 $loop->setTimeout(
function() use (&$check) {
35 $this->assertEquals(1, $check);
◆ testTimeoutOrder()
Sabre\Event\Loop\LoopTest::testTimeoutOrder |
( |
| ) |
|
Definition at line 39 of file LoopTest.php.
43 $loop->setTimeout(
function() use (&$check) {
48 $loop->setTimeout(
function() use (&$check) {
53 $loop->setTimeout(
function() use (&$check) {
61 $this->assertEquals([
'b',
'a',
'c'], $check);
The documentation for this class was generated from the following file: