Exemplo n.º 1
0
 public function testRun()
 {
     $expectedQuoteChar = substr(escapeshellarg(' '), 0, 1);
     $expectedCmd = 'phpcpd' . ' --log-pmd "some/report/file.xml"' . ' --min-lines 5' . ' --min-tokens 50' . ' "some/test/dir with space" "some/test/file with space.php"';
     $expectedCmd = str_replace('"', $expectedQuoteChar, $expectedCmd);
     $this->_cmd->expects($this->at(0))->method('_execShellCmd')->with($expectedCmd);
     $this->_cmd->run(array('some/test/dir with space', 'some/test/file with space.php'));
 }
Exemplo n.º 2
0
 public function testCopyPaste()
 {
     $reportFile = self::$_reportDir . '/phpcpd_report.xml';
     $cmd = new Inspection_CopyPasteDetector_Command($reportFile);
     if (!$cmd->canRun()) {
         $this->markTestSkipped('PHP Copy/Paste Detector command line is not available.');
     }
     $this->assertTrue($cmd->run(self::$_whiteList, self::$_blackList), "See detailed report in '{$reportFile}'.");
 }