You are here

protected function ContextAllAnyTest::setUp in Context 8.4

Overrides KernelTestBase::setUp

File

tests/src/Kernel/ContextAllAnyTest.php, line 63

Class

ContextAllAnyTest
Tests the context all condition plugin.

Namespace

Drupal\Tests\context\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $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);
  $this->container
    ->set('current_route_match', new CurrentRouteMatch($this->requestStack));

  // Set test module configuration.
  $this
    ->installConfig('context_all_any_test');
}