コード例 #1
0
ファイル: ReportTest.php プロジェクト: kingsj/core
 /**
  * Tests that the timer method returns the expected result.
  *
  * @return void
  * @covers PHP_PMD_Report
  * @group phpmd
  * @group unittest
  */
 public function testReportTimerReturnsMilliSeconds()
 {
     $start = microtime(true);
     $report = new PHP_PMD_Report();
     $report->start();
     usleep(50000);
     // 50 Milli Seconds
     $report->end();
     $time = ceil((microtime(true) - $start) * 1000.0);
     $this->assertGreaterThanOrEqual(50.0, $report->getElapsedTimeInMillis());
     $this->assertLessThanOrEqual($time, $report->getElapsedTimeInMillis());
 }