notImplementedCount() 공개 메소드

Gets the number of incomplete tests.
public notImplementedCount ( ) : integer
리턴 integer
예제 #1
0
 /**
  * @param  PHPUnit_Framework_TestResult  $result
  */
 protected function printIncompletes(PHPUnit_Framework_TestResult $result)
 {
     $this->printDefects($result->notImplemented(), $result->notImplementedCount(), 'incomplete test');
 }
 /**
  * Prints final results when all tests ended.
  *
  * PHPUnit_TextUI_ResultPrinter compatible
  *
  * @return void
  */
 public function printFooter(\PHPUnit_Framework_TestResult $result)
 {
     $testCount = $result->count();
     $assertionCount = $this->numAssertions;
     $failureCount = $result->failureCount();
     $errorCount = $result->errorCount();
     $incompleteCount = $result->notImplementedCount();
     $skipCount = $result->skippedCount();
     $riskyCount = $result->riskyCount();
     $resultStatus = $errorCount + $failureCount ? 'KO' : 'OK';
     $resultMessage = sprintf('Results %s. ', $resultStatus) . $this->formatCounters($testCount, $assertionCount, $failureCount, $errorCount, $incompleteCount, $skipCount, $riskyCount);
     $context = array('operation' => __FUNCTION__, 'status' => $resultStatus, 'testCount' => $testCount, 'assertionCount' => $assertionCount, 'failureCount' => $failureCount, 'errorCount' => $errorCount, 'incompleteCount' => $incompleteCount, 'skipCount' => $skipCount, 'riskyCount' => $riskyCount);
     $this->logger->notice($resultMessage, $context);
 }
예제 #3
0
 public function printResult(\PHPUnit_Framework_TestResult $result)
 {
     $upLine = str_repeat($this->colors ? '▁' : '-', $this->maxColumns);
     $dnLine = str_repeat($this->colors ? '▔' : '-', $this->maxColumns);
     $arrow = $this->colors ? '❯' : '=>';
     $this->printFailures();
     if (!count($this->exceptions)) {
         $ch = $this->colors ? ' ✔' : '';
         $upLine = "" . $upLine . "\n";
         $dnLine = "" . $dnLine . "\n";
         $str = "{$ch} OK {$arrow} Passed %s of %s";
         $str = sprintf($str, count($result->passed()), $result->count());
     } else {
         $ch = $this->colors ? ' ✖' : '';
         $upLine = "" . $upLine . "\n";
         $dnLine = "" . $dnLine . "\n";
         $str = "{$ch} KO {$arrow} Failed %s of %s";
         $str = sprintf($str, $result->failureCount() + $result->errorCount(), $result->count());
     }
     if (!$result->allCompletlyImplemented()) {
         $pair = array();
         if ($result->notImplementedCount() > 0) {
             $pair[] = $result->notImplementedCount() . ' not implemented';
         }
         if ($result->skippedCount() > 0) {
             $pair[] = $result->skippedCount() . ' skipped';
         }
         $str .= " with " . implode(' and ', $pair);
     }
     // Calculate time and peak memory usage
     $time = number_format($result->time(), 2);
     $mem = memory_get_peak_usage();
     $mem = round($mem / 1024 / 1024);
     // Add time spent
     $str .= " ({$time}s {$mem}Mb)\n";
     // Clean up the line above and print there
     $this->write("");
     $this->write($upLine);
     $this->write($str);
     $this->write($dnLine);
 }
예제 #4
0
    /**
     * Renders and output the tests statistics.
     *
     * @param PHPUnit_Framework_TestResult $testResult the test result
     *
     * @return void
     */
    protected function renderTestStatistics(PHPUnit_Framework_TestResult $testResult)
    {
        if ($testResult->wasSuccessful()) {
            $testStatistics = '<h2 class="wasSuccessful">' . $this->translate('testing_success') . '</h2>';
        } else {
            if ($testResult->errorCount() > 0) {
                $testStatistics = '<script type="text/javascript">/*<![CDATA[*/setProgressBarClass("hadError");/*]]>*/</script>
					<h2 class="hadError">' . $this->translate('testing_failure') . '</h2>';
            } else {
                $testStatistics = '<script type="text/javascript">/*<![CDATA[*/setProgressBarClass("hadFailure");/*]]>*/</script>
					<h2 class="hadFailure">' . $this->translate('testing_failure') . '</h2>';
            }
        }
        $testStatistics .= '<p>' . $testResult->count() . ' ' . $this->translate('tests_total') . ', ' . $this->testListener->assertionCount() . ' ' . $this->translate('assertions_total') . ', ' . $testResult->failureCount() . ' ' . $this->translate('tests_failures') . ', ' . $testResult->skippedCount() . ' ' . $this->translate('tests_skipped') . ', ' . $testResult->notImplementedCount() . ' ' . $this->translate('tests_incomplete') . ', ' . $testResult->errorCount() . ' ' . $this->translate('tests_errors') . ', <span title="' . $this->testStatistics->getTime() . '&nbsp;' . $this->translate('tests_seconds') . '">' . round($this->testStatistics->getTime(), 3) . '&nbsp;' . $this->translate('tests_seconds') . ', </span>' . t3lib_div::formatSize($this->testStatistics->getMemory()) . 'B (' . $this->testStatistics->getMemory() . ' B) ' . $this->translate('tests_leaks') . '</p>';
        $this->outputService->output($testStatistics);
    }
예제 #5
0
파일: PHPUnit.php 프로젝트: pago/pantr
 public static function formatTestResult(\PHPUnit_Framework_TestResult $result, $assertions)
 {
     $tests = $result->count();
     $errors = $result->errorCount();
     $failures = $result->failureCount();
     $skipped = $result->skippedCount();
     $incomplete = $result->notImplementedCount();
     $msg = self::formatResultPart($errors, 'error', 's');
     $msg .= self::formatResultPart($failures, 'failure', 's');
     $msg .= self::formatResultPart($skipped, 'skipped');
     $msg .= self::formatResultPart($incomplete, 'incomplete');
     return sprintf('%s (%d %s, %d %s%s)', $result->wasSuccessful() ? 'OK' : 'FAILED', $tests, $tests != 1 ? 'tests' : 'test', $assertions, $assertions != 1 ? 'assertions' : 'assertion', $msg);
 }