Beispiel #1
0
 /**
  * Tests Process::isOutputRedirected
  */
 public function testRedirect()
 {
     $cmd = new Cmd('echo');
     $cmd->addArgument('foo');
     $process = new Process();
     $process->addCommand($cmd);
     $this->assertFalse($process->isOutputRedirected());
     $process->redirectOutputTo('/tmp/foo');
     $this->assertTrue($process->isOutputRedirected());
     $this->assertEquals('/tmp/foo', $process->getRedirectPath());
 }
Beispiel #2
0
 /**
  * Tests Cmd::addArgument
  */
 public function testAddArgumentArray()
 {
     $cmd = new Cmd('foo');
     $cmd->addArgument(array('bar', 'baz'));
     $this->assertEquals('foo \'bar\' \'baz\'', (string) $cmd, 'arguments should be added');
 }