protected function LocalActionManagerTest::setUp in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Menu/LocalActionManagerTest.php \Drupal\Tests\Core\Menu\LocalActionManagerTest::setUp()
Overrides UnitTestCase::setUp
File
- core/
tests/ Drupal/ Tests/ Core/ Menu/ LocalActionManagerTest.php, line 106 - Contains \Drupal\Tests\Core\Menu\LocalActionManagerTest.
Class
- LocalActionManagerTest
- @coversDefaultClass \Drupal\Core\Menu\LocalActionManager @group Menu
Namespace
Drupal\Tests\Core\MenuCode
protected function setUp() {
$this->controllerResolver = $this
->getMock('Drupal\\Core\\Controller\\ControllerResolverInterface');
$this->request = $this
->getMock('Symfony\\Component\\HttpFoundation\\Request');
$this->routeProvider = $this
->getMock('Drupal\\Core\\Routing\\RouteProviderInterface');
$this->moduleHandler = $this
->getMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
$this->cacheBackend = $this
->getMock('Drupal\\Core\\Cache\\CacheBackendInterface');
$access_result = new AccessResultForbidden();
$this->accessManager = $this
->getMock('Drupal\\Core\\Access\\AccessManagerInterface');
$this->accessManager
->expects($this
->any())
->method('checkNamedRoute')
->willReturn($access_result);
$this->account = $this
->getMock('Drupal\\Core\\Session\\AccountInterface');
$this->discovery = $this
->getMock('Drupal\\Component\\Plugin\\Discovery\\DiscoveryInterface');
$this->factory = $this
->getMock('Drupal\\Component\\Plugin\\Factory\\FactoryInterface');
$route_match = $this
->getMock('Drupal\\Core\\Routing\\RouteMatchInterface');
$this->localActionManager = new TestLocalActionManager($this->controllerResolver, $this->request, $route_match, $this->routeProvider, $this->moduleHandler, $this->cacheBackend, $this->accessManager, $this->account, $this->discovery, $this->factory);
}