Example #1
0
 /**
  * @test
  */
 public function getTimeAfterStartAndStopReturnsPauseBeforeStop()
 {
     $this->subject->start();
     usleep(100000);
     $this->subject->stop();
     self::assertEquals(0.1, $this->subject->getTime(), '', 0.02);
 }
Example #2
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);
    }
 /**
  * @test
  */
 public function getMemoryAfterStartAfterMemoryUsageReturnsGreaterThanZero()
 {
     $this->fixture->start();
     array();
     $this->assertGreaterThan(0, $this->fixture->getMemory());
 }
Example #4
0
 /**
  * @test
  */
 public function getMemoryAfterStartAfterMemoryUsageReturnsGreaterThanZero()
 {
     $this->subject->start();
     array();
     self::assertGreaterThan(0, $this->subject->getMemory());
 }