You are here

protected function FileLogTestBase::setUp in File Log 8

Same name and namespace in other branches
  1. 2.0.x tests/src/Unit/FileLogTestBase.php \Drupal\Tests\filelog\Unit\FileLogTestBase::setUp()

Overrides UnitTestCase::setUp

2 calls to FileLogTestBase::setUp()
FileLogRotationTest::setUp in tests/src/Unit/FileLogRotationTest.php
FileLogTest::setUp in tests/src/Unit/FileLogTest.php
2 methods override FileLogTestBase::setUp()
FileLogRotationTest::setUp in tests/src/Unit/FileLogRotationTest.php
FileLogTest::setUp in tests/src/Unit/FileLogTest.php

File

tests/src/Unit/FileLogTestBase.php, line 29

Class

FileLogTestBase
Base class for file-base filelog tests.

Namespace

Drupal\Tests\filelog\Unit

Code

protected function setUp() : void {
  parent::setUp();
  $container = new ContainerBuilder();

  /** @var \Drupal\Core\StreamWrapper\StreamWrapperManagerInterface $swManager */
  $swManager = $this
    ->createMock(StreamWrapperManagerInterface::class);
  $settings = new Settings([]);

  /** @var \Psr\Log\LoggerInterface $logger */
  $logger = $this
    ->createMock(LoggerInterface::class);
  $this->fileSystem = new FileSystem($swManager, $settings, $logger);
  $container
    ->set('file_system', $this->fileSystem);
  Drupal::setContainer($container);
  $this->virtualFileSystem = vfsStream::setup('filelog');
}