You are here

class TestRouteSubscriber in Drupal 8

Same name in this branch
  1. 8 core/tests/Drupal/Tests/Core/Routing/RouteBuilderTest.php \Drupal\Tests\Core\Routing\TestRouteSubscriber
  2. 8 core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php \Drupal\Tests\views\Unit\EventSubscriber\TestRouteSubscriber
Same name and namespace in other branches
  1. 9 core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php \Drupal\Tests\views\Unit\EventSubscriber\TestRouteSubscriber

Provides a test route subscriber.

Hierarchy

Expanded class hierarchy of TestRouteSubscriber

File

core/modules/views/tests/src/Unit/EventSubscriber/RouteSubscriberTest.php, line 201
Contains \Drupal\Tests\views\Unit\EventSubscriber\RouteSubscriberTest.

Namespace

Drupal\Tests\views\Unit\EventSubscriber
View source
class TestRouteSubscriber extends RouteSubscriber {

  /**
   * The applicable views.
   *
   * @var array
   */
  public $applicableViews;

  /**
   * {@inheritdoc}
   */
  protected function getApplicableViews() {
    return $this->applicableViews;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RouteSubscriber::$state protected property The state key value store.
RouteSubscriber::$viewRouteNames protected property Stores an array of route names keyed by view_id.display_id.
RouteSubscriber::$viewsDisplayPairs protected property Stores a list of view,display IDs which haven't be used in the alter event.
RouteSubscriber::$viewStorage protected property The view storage.
RouteSubscriber::alterRoutes protected function Alters existing routes for a specific collection. Overrides RouteSubscriberBase::alterRoutes
RouteSubscriber::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. Overrides RouteSubscriberBase::getSubscribedEvents
RouteSubscriber::getViewsDisplayIDsWithRoute protected function Gets all the views and display IDs using a route.
RouteSubscriber::reset public function Resets the internal state of the route subscriber.
RouteSubscriber::routeRebuildFinished public function Stores the new route names after they have been rebuilt.
RouteSubscriber::routes public function Returns a set of route objects.
RouteSubscriber::__construct public function Constructs a \Drupal\views\EventSubscriber\RouteSubscriber instance.
RouteSubscriberBase::onAlterRoutes public function Delegates the route altering to self::alterRoutes(). 1
TestRouteSubscriber::$applicableViews public property The applicable views.
TestRouteSubscriber::getApplicableViews protected function Returns all views/display combinations with routes. Overrides RouteSubscriber::getApplicableViews