protected function MenuLinkTreeTest::setUp in Drupal 8
Same name in this branch
- 8 core/tests/Drupal/KernelTests/Core/Menu/MenuLinkTreeTest.php \Drupal\KernelTests\Core\Menu\MenuLinkTreeTest::setUp()
- 8 core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php \Drupal\Tests\system\Unit\Menu\MenuLinkTreeTest::setUp()
Same name and namespace in other branches
- 9 core/modules/system/tests/src/Unit/Menu/MenuLinkTreeTest.php \Drupal\Tests\system\Unit\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);
}