X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Fsimpletest%2Fsrc%2FRouteProvider.php;h=063c9567c16daf05e59e0e183d8421fc2fc4f8c5;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=edb330bf22b2da8ba5e66376f744592c38da01db;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/web/core/modules/simpletest/src/RouteProvider.php b/web/core/modules/simpletest/src/RouteProvider.php index edb330bf2..063c9567c 100644 --- a/web/core/modules/simpletest/src/RouteProvider.php +++ b/web/core/modules/simpletest/src/RouteProvider.php @@ -2,111 +2,15 @@ namespace Drupal\simpletest; -use Drupal\Core\Routing\PreloadableRouteProviderInterface; -use Symfony\Cmf\Component\Routing\PagedRouteProviderInterface; -use Symfony\Component\HttpFoundation\Request; +use Drupal\KernelTests\RouteProvider as CoreRouteProvider; /** * Rebuilds the router when the provider is instantiated. * - * @todo Move this outside of simpletest namespace to the Drupal\Tests, see - * https://www.drupal.org/node/2672762 + * @deprecated in 8.6.0 for removal before 9.0.0. Use + * Drupal\KernelTests\RouteProvider instead. + * + * @see https://www.drupal.org/node/2943146 */ -class RouteProvider implements PreloadableRouteProviderInterface, PagedRouteProviderInterface { - - use \Drupal\Core\DependencyInjection\DependencySerializationTrait; - - /** - * Loads the real route provider from the container and rebuilds the router. - * - * @return \Drupal\Core\Routing\PreloadableRouteProviderInterface|\Symfony\Cmf\Component\Routing\PagedRouteProviderInterface|\Symfony\Component\EventDispatcher\EventSubscriberInterface - * The route provider. - */ - protected function lazyLoadItself() { - if (!isset($this->service)) { - $container = \Drupal::getContainer(); - $this->service = $container->get('simpletest.router.route_provider'); - $container->get('router.builder')->rebuild(); - } - - return $this->service; - } - - /** - * {@inheritdoc} - */ - public function getRouteCollectionForRequest(Request $request) { - return $this->lazyLoadItself()->getRouteCollectionForRequest($request); - } - - /** - * {@inheritdoc} - */ - public function getRouteByName($name) { - return $this->lazyLoadItself()->getRouteByName($name); - } - - /** - * {@inheritdoc} - */ - public function preLoadRoutes($names) { - return $this->lazyLoadItself()->preLoadRoutes($names); - } - - /** - * {@inheritdoc} - */ - public function getRoutesByNames($names) { - return $this->lazyLoadItself()->getRoutesByNames($names); - } - - /** - * {@inheritdoc} - */ - public function getCandidateOutlines(array $parts) { - return $this->lazyLoadItself()->getCandidateOutlines($parts); - } - - /** - * {@inheritdoc} - */ - public function getRoutesByPattern($pattern) { - return $this->lazyLoadItself()->getRoutesByPattern($pattern); - } - - /** - * {@inheritdoc} - */ - public function routeProviderRouteCompare(array $a, array $b) { - return $this->lazyLoadItself()->routeProviderRouteCompare($a, $b); - } - - /** - * {@inheritdoc} - */ - public function getAllRoutes() { - return $this->lazyLoadItself()->getAllRoutes(); - } - - /** - * {@inheritdoc} - */ - public function reset() { - return $this->lazyLoadItself()->reset(); - } - - /** - * {@inheritdoc} - */ - public function getRoutesPaged($offset, $length = NULL) { - return $this->lazyLoadItself()->getRoutesPaged($offset, $length); - } - - /** - * {@inheritdoc} - */ - public function getRoutesCount() { - return $this->lazyLoadItself()->getRoutesCount(); - } - +class RouteProvider extends CoreRouteProvider { }