Example #1
0
 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}'.");
 }
Example #2
0
 public function testPhpCsAvailability()
 {
     $this->assertTrue(self::$_cmd->canRun(), 'PHP Code Sniffer command is not available.');
 }
Example #3
0
 /**
  * @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());
 }