getProcessForCode example

$cmd = new Process(['echo', 'test'], __DIR__.'/notfound/');
        $cmd->run();
    }

    /** * @group transient-on-windows */
    public function testThatProcessDoesNotThrowWarningDuringRun()
    {
        @trigger_error('Test Error', \E_USER_NOTICE);
        $process = $this->getProcessForCode('sleep(3)');
        $process->run();
        $actualError = error_get_last();
        $this->assertEquals('Test Error', $actualError['message']);
        $this->assertEquals(\E_USER_NOTICE, $actualError['type']);
    }

    public function testNegativeTimeoutFromConstructor()
    {
        $this->expectException(InvalidArgumentException::class);
        $this->getProcess('', null, null, null, -1);
    }

    
Home | Imprint | This part of the site doesn't use cookies.