diff --git a/core/lib/Drupal/Core/Update/UpdateKernel.php b/core/lib/Drupal/Core/Update/UpdateKernel.php index 6c5de73..04c4668 100755 --- a/core/lib/Drupal/Core/Update/UpdateKernel.php +++ b/core/lib/Drupal/Core/Update/UpdateKernel.php @@ -10,10 +10,13 @@ use Drupal\Core\DrupalKernel; use Drupal\Core\Session\AnonymousUserSession; use Drupal\Core\Site\Settings; +use Drupal\system\Tests\Routing\MockRouteProvider; use Symfony\Cmf\Component\Routing\RouteObjectInterface; use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; +use Symfony\Component\Routing\Route; +use Symfony\Component\Routing\RouteCollection; /** * Defines a kernel which is used primarily to run the update of Drupal. @@ -57,6 +60,26 @@ public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = } /** + * {@inheritdoc} + */ + protected function initializeContainer() { + $container = parent::initializeContainer(); + + $routes = new RouteCollection(); + + $routes->add('', new Route('/', ['_title' => 'Home'], ['_access' => 'TRUE'])); + $routes->add('', new Route('', [], ['_access' => 'TRUE'], ['_no_path' => TRUE])); + $routes->add('', new Route('')); + $routes->add('system.db_update', new Route('/update.php/{op}', ['op' => 'info'], ['_access' => 'TRUE'])); + + $mock_route_provider = new MockRouteProvider($routes); + $container->set('@router.route_provider', $mock_route_provider); + + return $container; + } + + + /** * Generates the actual result of update.php. * * The actual logic of the update is done in the db update controller.