You are here

protected function MenuActiveTrailTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Menu/MenuActiveTrailTest.php \Drupal\Tests\Core\Menu\MenuActiveTrailTest::setUp()

Overrides UnitTestCase::setUp

File

core/tests/Drupal/Tests/Core/Menu/MenuActiveTrailTest.php, line 74
Contains \Drupal\Tests\Core\Menu\MenuActiveTrailTest.

Class

MenuActiveTrailTest
Tests the active menu trail service.

Namespace

Drupal\Tests\Core\Menu

Code

protected function setUp() {
  parent::setUp();
  $this->requestStack = new RequestStack();
  $this->currentRouteMatch = new CurrentRouteMatch($this->requestStack);
  $this->menuLinkManager = $this
    ->getMock('Drupal\\Core\\Menu\\MenuLinkManagerInterface');
  $this->cache = $this
    ->getMock('\\Drupal\\Core\\Cache\\CacheBackendInterface');
  $this->lock = $this
    ->getMock('\\Drupal\\Core\\Lock\\LockBackendInterface');
  $this->menuActiveTrail = new MenuActiveTrail($this->menuLinkManager, $this->currentRouteMatch, $this->cache, $this->lock);
  $container = new Container();
  $container
    ->set('cache_tags.invalidator', $this
    ->getMock('\\Drupal\\Core\\Cache\\CacheTagsInvalidatorInterface'));
  \Drupal::setContainer($container);
}