You are here

protected function UnitTestCase::setUp in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/UnitTestCase.php \Drupal\Tests\UnitTestCase::setUp()
144 calls to UnitTestCase::setUp()
AcceptHeaderMatcherTest::setUp in core/modules/system/tests/modules/accept_header_routing_test/tests/Unit/AcceptHeaderMatcherTest.php
AccessAwareRouterTest::setUp in core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php
AccessManagerTest::setUp in core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php
AccessResultTest::setUp in core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
AliasManagerTest::setUp in core/tests/Drupal/Tests/Core/Path/AliasManagerTest.php

... See full list

259 methods override UnitTestCase::setUp()
AcceptHeaderMatcherTest::setUp in core/modules/system/tests/modules/accept_header_routing_test/tests/Unit/AcceptHeaderMatcherTest.php
AccessAwareRouterTest::setUp in core/tests/Drupal/Tests/Core/Routing/AccessAwareRouterTest.php
AccessManagerTest::setUp in core/tests/Drupal/Tests/Core/Access/AccessManagerTest.php
AccessResultTest::setUp in core/tests/Drupal/Tests/Core/Access/AccessResultTest.php
AggregatorPluginSettingsBaseTest::setUp in core/modules/aggregator/tests/src/Unit/Plugin/AggregatorPluginSettingsBaseTest.php

... See full list

File

core/tests/Drupal/Tests/UnitTestCase.php, line 42
Contains \Drupal\Tests\UnitTestCase.

Class

UnitTestCase
Provides a base class and helpers for Drupal unit tests.

Namespace

Drupal\Tests

Code

protected function setUp() {
  parent::setUp();

  // Ensure that an instantiated container in the global state of \Drupal from
  // a previous test does not leak into this test.
  \Drupal::unsetContainer();

  // Ensure that the NullFileCache implementation is used for the FileCache as
  // unit tests should not be relying on caches implicitly.
  FileCacheFactory::setConfiguration([
    'default' => [
      'class' => '\\Drupal\\Component\\FileCache\\NullFileCache',
    ],
  ]);
  $this->root = dirname(dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__))));
}