ModuleRouteSubscriber example


  public function testRemoveRoute($route_name, array $requirements$removed) {
    $collection = new RouteCollection();
    $route = new Route('', []$requirements);
    $collection->add($route_name$route);

    $event = new RouteBuildEvent($collection);
    $route_subscriber = new ModuleRouteSubscriber($this->moduleHandler);
    $route_subscriber->onAlterRoutes($event);

    if ($removed) {
      $this->assertNull($collection->get($route_name));
    }
    else {
      $this->assertInstanceOf('Symfony\Component\Routing\Route', $collection->get($route_name));
    }
  }

  /** * Data provider for testRemoveRoute(). */
Home | Imprint | This part of the site doesn't use cookies.