function run()
 {
     $res = NULL;
     if (PHPUnitUtil::$installedVersion == 3) {
         require_once 'PHPUnit/Framework/TestSuite.php';
         $res = new PHPUnit_Framework_TestResult();
     } else {
         require_once 'PHPUnit2/Framework/TestSuite.php';
         $res = new PHPUnit2_Framework_TestResult();
     }
     if ($this->codecoverage) {
         $res->collectCodeCoverageInformation(TRUE);
     }
     foreach ($this->formatters as $formatter) {
         $res->addListener($formatter);
     }
     $this->suite->run($res);
     if ($this->codecoverage) {
         $coverageInformation = $res->getCodeCoverageInformation();
         if (PHPUnitUtil::$installedVersion == 3) {
             CoverageMerger::merge($this->project, array($coverageInformation[0]['files']));
         } else {
             CoverageMerger::merge($this->project, $coverageInformation);
         }
     }
     if ($res->errorCount() != 0) {
         $this->retCode = self::ERRORS;
     } else {
         if ($res->failureCount() != 0 || $res->notImplementedCount() != 0) {
             $this->retCode = self::FAILURES;
         }
     }
 }
Esempio n. 2
0
 function run()
 {
     $result = new PHPUnit2_Framework_TestResult();
     $result->addListener($this->formatter);
     $this->suite->run($result);
     return $result;
 }
 function run()
 {
     $res = new PHPUnit2_Framework_TestResult();
     if ($this->codecoverage) {
         $res->collectCodeCoverageInformation(TRUE);
     }
     foreach ($this->formatters as $formatter) {
         $res->addListener($formatter);
     }
     $this->suite->run($res);
     if ($this->codecoverage) {
         CoverageMerger::merge($this->project, $res->getCodeCoverageInformation());
     }
     if ($res->errorCount() != 0) {
         $this->retCode = self::ERRORS;
     } else {
         if ($res->failureCount() != 0 || $res->notImplementedCount() != 0) {
             $this->retCode = self::FAILURES;
         }
     }
 }