/** * @test */ public function getTimeAfterStartAndStopReturnsPauseBeforeStop() { $this->fixture->start(); usleep(100000); $this->fixture->stop(); $this->assertEquals(0.1, $this->fixture->getTime(), '', 0.02); }
/** * 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() . ' ' . $this->translate('tests_seconds') . '">' . round($this->testStatistics->getTime(), 3) . ' ' . $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); }