function MenuLinkTreeTest::setUp
Same name in this branch
- 8.9.x core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php \Drupal\KernelTests\Core\Menu\MenuLinkTreeTest::setUp()
Same name in other branches
- 9 core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php \Drupal\Tests\system\Unit\Menu\MenuLinkTreeTest::setUp()
- 9 core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php \Drupal\KernelTests\Core\Menu\MenuLinkTreeTest::setUp()
- 10 core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php \Drupal\Tests\system\Unit\Menu\MenuLinkTreeTest::setUp()
- 10 core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php \Drupal\KernelTests\Core\Menu\MenuLinkTreeTest::setUp()
- 11.x core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php \Drupal\Tests\system\Unit\Menu\MenuLinkTreeTest::setUp()
- 11.x core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php \Drupal\KernelTests\Core\Menu\MenuLinkTreeTest::setUp()
Overrides UnitTestCase::setUp
File
-
core/
modules/ system/ tests/ src/ Unit/ Menu/ MenuLinkTreeTest.php, line 31
Class
- MenuLinkTreeTest
- @coversDefaultClass \Drupal\Core\Menu\MenuLinkTree @group Menu
Namespace
Drupal\Tests\system\Unit\MenuCode
protected function setUp() {
parent::setUp();
$this->menuLinkTree = new MenuLinkTree($this->createMock('\\Drupal\\Core\\Menu\\MenuTreeStorageInterface'), $this->createMock('\\Drupal\\Core\\Menu\\MenuLinkManagerInterface'), $this->createMock('\\Drupal\\Core\\Routing\\RouteProviderInterface'), $this->createMock('\\Drupal\\Core\\Menu\\MenuActiveTrailInterface'), $this->createMock('\\Drupal\\Core\\Controller\\ControllerResolverInterface'));
$cache_contexts_manager = $this->getMockBuilder('Drupal\\Core\\Cache\\Context\\CacheContextsManager')
->disableOriginalConstructor()
->getMock();
$cache_contexts_manager->method('assertValidTokens')
->willReturn(TRUE);
$container = new ContainerBuilder();
$container->set('cache_contexts_manager', $cache_contexts_manager);
\Drupal::setContainer($container);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.