function RouteBuilderTest::setUp
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php \Drupal\Tests\Core\Routing\RouteBuilderTest::setUp()
- 8.9.x core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php \Drupal\Tests\Core\Routing\RouteBuilderTest::setUp()
- 11.x core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php \Drupal\Tests\Core\Routing\RouteBuilderTest::setUp()
Overrides UnitTestCase::setUp
File
-
core/
tests/ Drupal/ Tests/ Core/ Routing/ RouteBuilderTest.php, line 81
Class
- RouteBuilderTest
- @coversDefaultClass \Drupal\Core\Routing\RouteBuilder @group Routing
Namespace
Drupal\Tests\Core\RoutingCode
protected function setUp() : void {
parent::setUp();
$this->dumper = $this->createMock('Drupal\\Core\\Routing\\MatcherDumperInterface');
$this->lock = $this->createMock('Drupal\\Core\\Lock\\LockBackendInterface');
$this->dispatcher = $this->prophesize('\\Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface');
$this->dispatcher
->dispatch(Argument::cetera(), Argument::cetera())
->willReturnArgument(0);
$this->moduleHandler = $this->createMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
$this->controllerResolver = $this->createMock('Drupal\\Core\\Controller\\ControllerResolverInterface');
$this->yamlDiscovery = $this->getMockBuilder('\\Drupal\\Core\\Discovery\\YamlDiscovery')
->disableOriginalConstructor()
->getMock();
$this->checkProvider = $this->createMock('\\Drupal\\Core\\Access\\CheckProviderInterface');
$this->routeBuilder = new TestRouteBuilder($this->dumper, $this->lock, $this->dispatcher
->reveal(), $this->moduleHandler, $this->controllerResolver, $this->checkProvider);
$this->routeBuilder
->setYamlDiscovery($this->yamlDiscovery);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.