[Process] Add failing test for callbacks on windows
This commit is contained in:
parent
e2c36c544d
commit
0c5aa8bf7e
@ -68,6 +68,18 @@ class ProcessTest extends \PHPUnit_Framework_TestCase
|
||||
$this->assertSame(0, $p->getExitCode());
|
||||
}
|
||||
|
||||
public function testCallbackIsExecutedForOutput()
|
||||
{
|
||||
$p = new Process(sprintf('php -r %s', escapeshellarg('echo \'foo\';')));
|
||||
|
||||
$called = false;
|
||||
$p->run(function ($type, $buffer) use (&$called) {
|
||||
$called = $buffer === 'foo';
|
||||
});
|
||||
|
||||
$this->assertTrue($called, 'The callback should be executed with the output');
|
||||
}
|
||||
|
||||
public function testExitCodeText()
|
||||
{
|
||||
$process = new Process('');
|
||||
|
Reference in New Issue
Block a user