/** * @dataProvider getVersionDataProvider */ public function testGetVersion($versionCmdOutput, $expectedVersion) { $cmdCallback = function ($shellCmd, array &$output = null) use($versionCmdOutput) { $output = array($versionCmdOutput); return !empty($shellCmd); }; $this->_cmd->expects($this->once())->method('_execShellCmd')->with($this->stringContains('phpcpd'))->will($this->returnCallback($cmdCallback)); $this->assertEquals($expectedVersion, $this->_cmd->getVersion()); }
/** * @dataProvider getVersionDataProvider */ public function testGetVersion($versionCmdOutput, $expectedVersion) { $this->_cmd->expects($this->once())->method('_execShellCmd')->with($this->stringContains('phpcpd'))->will($this->returnValue($versionCmdOutput)); $this->assertEquals($expectedVersion, $this->_cmd->getVersion()); }