protected function FileLogRotationTest::setUp in File Log 8
Same name and namespace in other branches
- 2.0.x tests/src/Unit/FileLogRotationTest.php \Drupal\Tests\filelog\Unit\FileLogRotationTest::setUp()
Overrides FileLogTestBase::setUp
File
- tests/
src/ Unit/ FileLogRotationTest.php, line 59
Class
- FileLogRotationTest
- Tests the log rotation of the file logger.
Namespace
Drupal\Tests\filelog\UnitCode
protected function setUp() : void {
parent::setUp();
// Force UTC time to avoid platform-specific effects.
date_default_timezone_set('UTC');
$this->fileManager = $this
->getMockBuilder(LogFileManager::class)
->disableOriginalConstructor()
->getMock();
$this->fileManager
->method('getFileName')
->willReturn('vfs://filelog/' . LogFileManager::FILENAME);
$this->token = $this
->getMockBuilder(Token::class)
->disableOriginalConstructor()
->getMock();
$this->token
->method('replace')
->willReturnCallback([
static::class,
'tokenReplace',
]);
$this->time = $this
->getMockBuilder(TimeInterface::class)
->getMock();
$this->time
->method('getRequestTime')
->willReturn(86401);
}