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()); }
/** * @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; }
/** * @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)); }