function RouteBuilderTest::setUp

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php \Drupal\Tests\Core\Routing\RouteBuilderTest::setUp()
  2. 10 core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php \Drupal\Tests\Core\Routing\RouteBuilderTest::setUp()
  3. 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 80

Class

RouteBuilderTest
@coversDefaultClass \Drupal\Core\Routing\RouteBuilder @group Routing

Namespace

Drupal\Tests\Core\Routing

Code

protected function setUp() {
    $this->dumper = $this->createMock('Drupal\\Core\\Routing\\MatcherDumperInterface');
    $this->lock = $this->createMock('Drupal\\Core\\Lock\\LockBackendInterface');
    $this->dispatcher = $this->createMock('\\Symfony\\Component\\EventDispatcher\\EventDispatcherInterface');
    $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, $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.