Ejemplo n.º 1
0
 public function testGetPath()
 {
     $expected = escapeshellarg('foo');
     $this->driver->expects($this->once())->method('find')->will($this->returnValue('foo'));
     $this->assertEquals($expected, $this->finder->getPath());
     // test lazy load
     $this->assertEquals($expected, $this->finder->getPath());
 }
Ejemplo n.º 2
0
 /**
  * @param string $command
  *
  * @return string
  */
 public function prepare($command)
 {
     // change path for php
     if (substr($command, 0, 4) == 'php ') {
         $command = $this->finder->getPath() . substr($command, 3);
     }
     // change path to console
     $command = str_replace(' app/console ', ' ' . $this->console . ' ', $command);
     // change /dev/null for Windows
     if (defined('PHP_WINDOWS_VERSION_BUILD')) {
         $command = str_replace('/dev/null', 'nul', $command);
     }
     return $command;
 }
Ejemplo n.º 3
0
 /**
  * @dataProvider getCommands
  *
  * @param string $command
  * @param string $expected
  */
 public function testPrepare($command, $expected)
 {
     $this->finder->expects($this->any())->method('getPath')->will($this->returnValue('/path/to/php'));
     $this->assertEquals($expected, $this->getCommandExecutor()->prepare($command));
 }