Esempio n. 1
0
 /**
  * @ticket 126
  * @dataProvider issue126Provider
  */
 public function testIssue126IsFixed($fileNumber, $cloc)
 {
     $file = __DIR__ . '/_files/issue_126/issue_126_' . $fileNumber . '.php';
     $result = $this->analyser->countFiles(array($file), false);
     $assertString = sprintf('Failed asserting that %s matches expected %s in issue_126_%d.php', $result['cloc'], $cloc, $fileNumber);
     $this->assertEquals($cloc, $result['cloc'], $assertString);
     $this->resetAnalyser();
 }
Esempio n. 2
0
 /**
  * Run the task.
  *
  * @param array &$options Additional options.
  *
  * @return integer Number of errors.
  */
 public function run(&$options)
 {
     require 'SebastianBergmann/FinderFacade/autoload.php';
     require 'SebastianBergmann/PHPLOC/autoload.php';
     $finder = new SebastianBergmann\FinderFacade\FinderFacade(array(realpath($this->_config->getPath())));
     $files = $finder->findFiles();
     $analyser = new SebastianBergmann\PHPLOC\Analyser(new \ezcConsoleOutput());
     $count = $analyser->countFiles($files, true);
     $printer = new SebastianBergmann\PHPLOC\TextUI\ResultPrinter();
     $printer->printResult($count, true);
 }
Esempio n. 3
0
 /**
  * @ticket 112
  */
 public function testIssue112IsFixed()
 {
     $result = $this->analyser->countFiles(array(__DIR__ . '/_files/issue_112.php'), false);
     $this->assertEquals(5, $result['loc']);
 }
Esempio n. 4
0
 protected function getCountForFiles($files)
 {
     $analyser = new SebastianBergmann\PHPLOC\Analyser();
     return $analyser->countFiles($files, $this->countTests);
 }
Esempio n. 5
0
 /**
  * @ticket 139
  */
 public function testIssue139IsFixed()
 {
     error_reporting(E_ALL);
     $result = $this->analyser->countFiles(array(__DIR__ . '/_files/issue_139.php'), false);
     $this->assertEquals(1, $result['anonymousFunctions']);
 }
 /**
  * @ticket 64
  */
 public function testIssue64IsFixed()
 {
     $result = $this->analyser->countFiles(array(__DIR__ . '/_files/issue_62.php'), FALSE);
     $this->assertEquals(1, $result['cloc']);
 }