function MenuActiveTrailTest::setUp
Overrides UnitTestCase::setUp
File
- 
              core/tests/ Drupal/ Tests/ Core/ Menu/ MenuActiveTrailTest.php, line 69 
Class
- MenuActiveTrailTest
- Tests the active menu trail service.
Namespace
Drupal\Tests\Core\MenuCode
protected function setUp() : void {
  parent::setUp();
  $this->requestStack = new RequestStack();
  $this->currentRouteMatch = new CurrentRouteMatch($this->requestStack);
  $this->menuLinkManager = $this->createMock('Drupal\\Core\\Menu\\MenuLinkManagerInterface');
  $this->cache = $this->createMock('\\Drupal\\Core\\Cache\\CacheBackendInterface');
  $this->lock = $this->createMock('\\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->createMock('\\Drupal\\Core\\Cache\\CacheTagsInvalidatorInterface'));
  \Drupal::setContainer($container);
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
