Comos\Qpm\Process\ProcessTest::testForkByCallable PHP Метод

testForkByCallable() публичный Метод

public testForkByCallable ( )
    public function testForkByCallable()
    {
        $current = Process::current();
        $logFile = $this->_logFile;
        $func = function () use($logFile) {
            usleep(500 * 1000);
            \file_put_contents($logFile, 'x', \FILE_APPEND);
        };
        Process::fork($func);
        Process::fork($func);
        $c = \file_get_contents($this->_logFile);
        $this->assertEquals('', $c);
        \usleep(800 * 1000);
        $c = \file_get_contents($this->_logFile);
        $this->assertEquals('xx', $c);
    }