notImplemented() public method

Returns an Enumeration for the incomplete tests.
public notImplemented ( ) : array
return array
Example #1
0
File: Factory.php Project: cwcw/cms
 /**
  * Creates a Streamwide_PHPUnit_Runner_TestCaseResult from a PHPUnit_Framework_TestResult.
  *
  * @param Streamwide_PHPUnit_Runner_TestCase    $testCase   test case
  * @param PHPUnit_Framework_TestResult $testResult test result
  * @return Streamwide_PHPUnit_Runner_TestCaseResult test case result
  */
 public static function fromPHPUnitTestResult(Streamwide_PHPUnit_Runner_TestCase $testCase, PHPUnit_Framework_TestResult $testResult)
 {
     $passed = $testResult->passed();
     $skipped = $testResult->skipped();
     $errors = $testResult->errors();
     $failures = $testResult->failures();
     $notImplemented = $testResult->notImplemented();
     $time = $testResult->time();
     $statusMessage = null;
     $codeCoverage = null;
     if (!empty($passed)) {
         $status = Streamwide_PHPUnit_Runner_TestCaseResult::PASSED;
         $codeCoverage = $testResult->getCodeCoverageInformation();
     } else {
         if (!empty($skipped)) {
             $status = Streamwide_PHPUnit_Runner_TestCaseResult::SKIPPED;
             $statusMessage = $skipped[0]->toStringVerbose(true);
         } else {
             if (!empty($notImplemented)) {
                 $status = Streamwide_PHPUnit_Runner_TestCaseResult::NOT_IMPLEMENTED;
                 $statusMessage = $notImplemented[0]->toStringVerbose(true);
             } else {
                 if (!empty($errors)) {
                     $status = Streamwide_PHPUnit_Runner_TestCaseResult::ERROR;
                     $statusMessage = $errors[0]->toStringVerbose(true) . PHPUnit_Util_Filter::getFilteredStacktrace($errors[0]->thrownException());
                 } else {
                     if (!empty($failures)) {
                         $status = Streamwide_PHPUnit_Runner_TestCaseResult::FAILED;
                         $statusMessage = $failures[0]->toStringVerbose(true) . PHPUnit_Util_Filter::getFilteredStacktrace($failures[0]->thrownException());
                     }
                 }
             }
         }
     }
     $testCaseResult = new Streamwide_PHPUnit_Runner_TestCaseResult($testCase, $status, $statusMessage, null, $time, $codeCoverage);
     return $testCaseResult;
 }
Example #2
0
 /**
  * @param  PHPUnit_Framework_Test       $test
  * @param  PHPUnit_Framework_TestResult $result
  * @return mixed
  */
 public static function lookupResult(PHPUnit_Framework_Test $test, PHPUnit_Framework_TestResult $result)
 {
     $testName = self::describe($test);
     foreach ($result->errors() as $error) {
         if ($testName == self::describe($error->failedTest())) {
             return $error;
         }
     }
     foreach ($result->failures() as $failure) {
         if ($testName == self::describe($failure->failedTest())) {
             return $failure;
         }
     }
     foreach ($result->notImplemented() as $notImplemented) {
         if ($testName == self::describe($notImplemented->failedTest())) {
             return $notImplemented;
         }
     }
     foreach ($result->skipped() as $skipped) {
         if ($testName == self::describe($skipped->failedTest())) {
             return $skipped;
         }
     }
     return PHPUnit_Runner_BaseTestRunner::STATUS_PASSED;
 }
Example #3
0
 /**
  * @param  PHPUnit_Framework_TestResult  $result
  */
 protected function printIncompletes(PHPUnit_Framework_TestResult $result)
 {
     $this->printDefects($result->notImplemented(), $result->notImplementedCount(), 'incomplete test');
 }
Example #4
0
 /**
  * Parse the test suite result
  *
  * @param \PHPUnit_Framework_TestResult $result
  * @return array<string,double|integer|array>
  */
 private function parseTestSuite($result)
 {
     $passed = 0;
     $error = 0;
     $failed = 0;
     $notImplemented = 0;
     $skipped = 0;
     $tests = [];
     foreach ($result->passed() as $key => $value) {
         $tests[] = $this->parseTest('passed', $key);
         $passed++;
     }
     foreach ($result->failures() as $obj) {
         $tests[] = $this->parseTest('failed', $obj);
         $failed++;
     }
     foreach ($result->skipped() as $obj) {
         $tests[] = $this->parseTest('skipped', $obj);
         $skipped++;
     }
     foreach ($result->notImplemented() as $obj) {
         $tests[] = $this->parseTest('notImplemented', $obj);
         $notImplemented++;
     }
     foreach ($result->errors() as $obj) {
         $tests[] = $this->parseTest('error', $obj);
         $error++;
     }
     usort($tests, function ($a, $b) {
         return strnatcmp($a['class'], $b['class']);
     });
     return ['time' => $result->time(), 'total' => count($tests), 'passed' => $passed, 'error' => $error, 'failed' => $failed, 'notImplemented' => $notImplemented, 'skipped' => $skipped, 'tests' => $tests];
 }