[Process] Add failing test for callbacks on windows

This commit is contained in:
Jordi Boggiano 2012-05-24 19:52:29 +02:00
parent e2c36c544d
commit 0c5aa8bf7e

View File

@ -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('');