function TimeTest::testGetRequestMicroTimeNoRequest

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Datetime/TimeTest.php \Drupal\Tests\Component\Datetime\TimeTest::testGetRequestMicroTimeNoRequest()
  2. 8.9.x core/tests/Drupal/Tests/Component/Datetime/TimeTest.php \Drupal\Tests\Component\Datetime\TimeTest::testGetRequestMicroTimeNoRequest()
  3. 10 core/tests/Drupal/Tests/Component/Datetime/TimeTest.php \Drupal\Tests\Component\Datetime\TimeTest::testGetRequestMicroTimeNoRequest()

@covers ::getRequestMicroTime

File

core/tests/Drupal/Tests/Component/Datetime/TimeTest.php, line 101

Class

TimeTest
Tests the Time class.

Namespace

Drupal\Tests\Component\Datetime

Code

public function testGetRequestMicroTimeNoRequest() : void {
    $expected = 1234567.89;
    unset($_SERVER['REQUEST_TIME_FLOAT']);
    $this->assertEquals($expected, $this->time
        ->getRequestMicroTime());
    $_SERVER['REQUEST_TIME_FLOAT'] = 2345678.9;
    $this->assertEquals(2345678.9, $this->time
        ->getRequestMicroTime());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.