You are here

protected function RequestPathTest::setUp in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Plugin/Condition/RequestPathTest.php \Drupal\KernelTests\Core\Plugin\Condition\RequestPathTest::setUp()

Overrides KernelTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Plugin/Condition/RequestPathTest.php, line 57

Class

RequestPathTest
Tests that the Request Path Condition, provided by the system module, is working properly.

Namespace

Drupal\KernelTests\Core\Plugin\Condition

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installSchema('system', [
    'sequences',
  ]);
  $this->pluginManager = $this->container
    ->get('plugin.manager.condition');

  // Set a mock alias manager in the container.
  $this->aliasManager = new MockAliasManager();
  $this->container
    ->set('path_alias.manager', $this->aliasManager);

  // Set the test request stack in the container.
  $this->requestStack = new RequestStack();
  $this->container
    ->set('request_stack', $this->requestStack);
  $this->currentPath = new CurrentPathStack($this->requestStack);
  $this->container
    ->set('path.current', $this->currentPath);
}