diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php index b24f12a..c21f43e 100644 --- a/core/lib/Drupal/Core/DrupalKernel.php +++ b/core/lib/Drupal/Core/DrupalKernel.php @@ -724,7 +724,7 @@ protected function initializeContainer($rebuild = FALSE) { // new session into the master request if one was present before. if (($request_stack = $this->container->get('request_stack', ContainerInterface::NULL_ON_INVALID_REFERENCE))) { if ($request = $request_stack->getMasterRequest()) { - if (!$request->hasSession()) { + if ($request->hasSession()) { $request->setSession($this->container->get('session')); } } diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index 398909f..d6cec81 100644 --- a/core/scripts/run-tests.sh +++ b/core/scripts/run-tests.sh @@ -36,6 +36,7 @@ $kernel->loadLegacyIncludes();; if ($args['execute-test']) { + $kernel->prepareLegacyRequest($request); simpletest_script_setup_database(); simpletest_script_run_one_test($args['test-id'], $args['execute-test']); // Sub-process exited already; this is just for clarity.