ProcessTest::testWait PHP Method

testWait() public method

public testWait ( )
    public function testWait()
    {
        $this->process_thread = new MyThread();
        $this->process_runnable = new \Jenner\SimpleFork\Process(new MyRunnable());
        $this->process_callback = new \Jenner\SimpleFork\Process(function () {
            for ($i = 0; $i < 3; $i++) {
                //                echo "callback pid:" . getmypid() . PHP_EOL;
            }
        });
        $this->process_thread->start();
        $this->process_thread->wait();
        $this->assertEquals(0, $this->process_thread->errno());
        $this->assertEquals($this->process_thread->errno(), 0);
        $this->assertEquals($this->process_thread->errmsg(), 'Success');
        $this->assertEquals($this->process_thread->isRunning(), false);
        $this->process_runnable->start();
        $this->process_runnable->wait();
        $this->assertEquals(0, $this->process_runnable->errno());
        $this->process_callback->start();
        $this->process_callback->wait();
        $this->assertEquals(0, $this->process_callback->errno());
    }