public function testCodeStyle() { $reportFile = self::$_reportDir . '/phpcs_report.xml'; $cmd = new Inspection_CodeSniffer_Command(realpath(__DIR__ . '/_files/phpcs'), $reportFile); if (!$cmd->canRun()) { $this->markTestSkipped('PHP Code Sniffer command is not available.'); } $cmd->setExtensions(array('php', 'phtml')); $this->assertTrue($cmd->run(self::$_whiteList, self::$_blackList), "See detailed report in '{$reportFile}'."); }
public function testPhpCsAvailability() { $this->assertTrue(self::$_cmd->canRun(), 'PHP Code Sniffer command is not available.'); }
/** * @dataProvider canRunDataProvider */ public function testCanRun($cmdOutput, $expectedResult) { $this->_cmd->expects($this->once())->method('_execShellCmd')->with($this->stringContains('phpcs'))->will($this->returnValue($cmdOutput)); $this->assertEquals($expectedResult, $this->_cmd->canRun()); }