class TestRouteBuilder in Drupal 8
Extends the core route builder with a setter method for the YAML discovery.
Hierarchy
- class \Drupal\Core\Routing\RouteBuilder implements DestructableInterface, RouteBuilderInterface
- class \Drupal\Tests\Core\Routing\TestRouteBuilder
Expanded class hierarchy of TestRouteBuilder
File
- core/
tests/ Drupal/ Tests/ Core/ Routing/ RouteBuilderTest.php, line 327 - Contains \Drupal\Tests\Core\Routing\RouteBuilderTest.
Namespace
Drupal\Tests\Core\RoutingView source
class TestRouteBuilder extends RouteBuilder {
/**
* The mocked YAML discovery.
*
* @var \Drupal\Core\Discovery\YamlDiscovery|\PHPUnit\Framework\MockObject\MockObject
*/
protected $yamlDiscovery;
/**
* Sets the YAML discovery.
*
* @param \Drupal\Core\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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RouteBuilder:: |
protected | property | Flag that indicates if we are currently rebuilding the routes. | |
RouteBuilder:: |
protected | property | The check provider. | |
RouteBuilder:: |
protected | property | The controller resolver. | |
RouteBuilder:: |
protected | property | The event dispatcher to notify of routes. | |
RouteBuilder:: |
protected | property | The dumper to which we should send collected routes. | |
RouteBuilder:: |
protected | property | The used lock backend instance. | |
RouteBuilder:: |
protected | property | The module handler. | |
RouteBuilder:: |
protected | property | Flag that indicates if we should rebuild at the end of the request. | |
RouteBuilder:: |
protected | property | The route collection during the rebuild. | |
RouteBuilder:: |
public | function |
Performs destruct operations. Overrides DestructableInterface:: |
|
RouteBuilder:: |
public | function |
Rebuilds the route information and dumps it. Overrides RouteBuilderInterface:: |
|
RouteBuilder:: |
public | function |
Rebuilds the route information if necessary, and dumps it. Overrides RouteBuilderInterface:: |
|
RouteBuilder:: |
public | function |
Sets the router to be rebuilt next time rebuildIfNeeded() is called. Overrides RouteBuilderInterface:: |
|
RouteBuilder:: |
public | function | Constructs the RouteBuilder using the passed MatcherDumperInterface. | |
TestRouteBuilder:: |
protected | property | The mocked YAML discovery. | |
TestRouteBuilder:: |
protected | function |
Retrieves all defined routes from .routing.yml files. Overrides RouteBuilder:: |
|
TestRouteBuilder:: |
public | function | Sets the YAML discovery. |