LoopTest::testLoop()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace AsyncPHP\Process\Tests;
4
5
use AsyncPHP\Process\PosixHandler;
6
use PHPUnit_Framework_TestCase;
7
8
class LoopTest extends PHPUnit_Framework_TestCase
9
{
10
    public function testLoop()
11
    {
12
        $loop = new PosixHandler();
13
        $loop->start("loop", "php -r 'while (true) { sleep(1); }'", true);
14
15
        $this->assertTrue($loop->running("loop"));
16
17
        $loop->stop("loop");
18
19
        $this->assertFalse($loop->running("loop"));
20
    }
21
}
22