function TimeTest::testGetRequestTimeNoRequest
Same name in other branches
- 9 core/tests/Drupal/Tests/Component/Datetime/TimeTest.php \Drupal\Tests\Component\Datetime\TimeTest::testGetRequestTimeNoRequest()
- 8.9.x core/tests/Drupal/Tests/Component/Datetime/TimeTest.php \Drupal\Tests\Component\Datetime\TimeTest::testGetRequestTimeNoRequest()
- 10 core/tests/Drupal/Tests/Component/Datetime/TimeTest.php \Drupal\Tests\Component\Datetime\TimeTest::testGetRequestTimeNoRequest()
@covers ::getRequestTime
File
-
core/
tests/ Drupal/ Tests/ Component/ Datetime/ TimeTest.php, line 88
Class
- TimeTest
- Tests the Time class.
Namespace
Drupal\Tests\Component\DatetimeCode
public function testGetRequestTimeNoRequest() : void {
// With no request, and no global variable, we expect to get the int part
// of the microtime.
$expected = 1234567;
unset($_SERVER['REQUEST_TIME']);
$this->assertEquals($expected, $this->time
->getRequestTime());
$_SERVER['REQUEST_TIME'] = 23456789;
$this->assertEquals(23456789, $this->time
->getRequestTime());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.