You are here

class TestRouteBuilder in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php \Drupal\Tests\Core\Routing\TestRouteBuilder

Extends the core route builder with a setter method for the YAML discovery.

Hierarchy

Expanded class hierarchy of TestRouteBuilder

File

core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php, line 281
Contains \Drupal\Tests\Core\Routing\RouteBuilderTest.

Namespace

Drupal\Tests\Core\Routing
View source
class TestRouteBuilder extends RouteBuilder {

  /**
   * The mocked YAML discovery.
   *
   * @var \Drupal\Component\Discovery\YamlDiscovery|\PHPUnit_Framework_MockObject_MockObject
   */
  protected $yamlDiscovery;

  /**
   * Sets the YAML discovery.
   *
   * @param \Drupal\Component\Discovery\YamlDiscovery $yaml_discovery
   *   The YAML discovery to set.
   */
  public function setYamlDiscovery(YamlDiscovery $yaml_discovery) {
    $this->yamlDiscovery = $yaml_discovery;
  }

  /**
   * {@inheritdoc}
   */
  protected function getRouteDefinitions() {
    return $this->yamlDiscovery
      ->findAll();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RouteBuilder::$building protected property Flag that indicates if we are currently rebuilding the routes.
RouteBuilder::$checkProvider protected property The check provider.
RouteBuilder::$controllerResolver protected property The controller resolver.
RouteBuilder::$dispatcher protected property The event dispatcher to notify of routes.
RouteBuilder::$dumper protected property The dumper to which we should send collected routes.
RouteBuilder::$lock protected property The used lock backend instance.
RouteBuilder::$moduleHandler protected property The module handler.
RouteBuilder::$rebuildNeeded protected property Flag that indicates if we should rebuild at the end of the request.
RouteBuilder::$routeCollection protected property The route collection during the rebuild.
RouteBuilder::destruct public function Performs destruct operations. Overrides DestructableInterface::destruct
RouteBuilder::rebuild public function Rebuilds the route info and dumps to dumper. Overrides RouteBuilderInterface::rebuild
RouteBuilder::rebuildIfNeeded public function Rebuilds the route info and dumps to dumper if necessary. Overrides RouteBuilderInterface::rebuildIfNeeded
RouteBuilder::setRebuildNeeded public function Sets the router to be rebuilt next time rebuildIfNeeded() is called. Overrides RouteBuilderInterface::setRebuildNeeded
RouteBuilder::__construct public function Constructs the RouteBuilder using the passed MatcherDumperInterface.
TestRouteBuilder::$yamlDiscovery protected property The mocked YAML discovery.
TestRouteBuilder::getRouteDefinitions protected function Retrieves all defined routes from .routing.yml files. Overrides RouteBuilder::getRouteDefinitions
TestRouteBuilder::setYamlDiscovery public function Sets the YAML discovery.