public function testCanRun() { $result = false; try { $result = self::$_cmd->canRun(); } catch (Exception $e) { $this->fail($e->getMessage()); } $this->assertTrue($result, true); }
public function testRun() { $this->_cmd->expects($this->any())->method('_getHostScript')->will($this->returnValue('cscript')); $this->_cmd->expects($this->any())->method('_getJsHintPath')->will($this->returnValue('jshint-path')); $this->_cmd->expects($this->any())->method('getFileName')->will($this->returnValue('mage.js')); $this->_cmd->expects($this->once())->method('_execShellCmd')->with('cscript "jshint-path" "mage.js" '); $this->_cmd->run(array()); }
/** * @dataProvider codeJsHintDataProvider */ public function testCodeJsHint($filename) { $cmd = new Inspection_JsHint_Command($filename, self::$_reportFile); $result = false; try { $result = $cmd->canRun(); } catch (Exception $e) { $this->markTestSkipped($e->getMessage()); } if ($result) { $this->assertTrue($cmd->run(array()), $cmd->getLastRunMessage()); } }