diff --git a/core/lib/Drupal/Core/DrupalKernelInterface.php b/core/lib/Drupal/Core/DrupalKernelInterface.php index ca94511..e7da727 100644 --- a/core/lib/Drupal/Core/DrupalKernelInterface.php +++ b/core/lib/Drupal/Core/DrupalKernelInterface.php @@ -53,6 +53,7 @@ public function getServiceProviders($origin); * Force a container rebuild. * * @return \Symfony\Component\DependencyInjection\ContainerInterface + * The rebuilt container. */ public function rebuildContainer(); diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php index 9a86e8a..beb3720 100644 --- a/core/modules/simpletest/src/WebTestBase.php +++ b/core/modules/simpletest/src/WebTestBase.php @@ -1491,7 +1491,7 @@ protected function isInChildSite() { * @param array $curl_options * (optional) Additional curl options. * - * @return + * @return string * The retrieved HTML string, also available as $this->getRawContent() */ protected function drupalGet($path, array $options = array(), array $headers = array(), array $curl_options = array()) { diff --git a/core/modules/system/tests/modules/session_test/session_test.routing.yml b/core/modules/system/tests/modules/session_test/session_test.routing.yml index c638efc..2090a0d 100644 --- a/core/modules/system/tests/modules/session_test/session_test.routing.yml +++ b/core/modules/system/tests/modules/session_test/session_test.routing.yml @@ -84,12 +84,24 @@ session_test.trace_handler: requirements: _access: 'TRUE' - session_test.get_session: path: '/session-test/get-session' defaults: + _title: 'Get session information using basic authentication' _controller: '\Drupal\session_test\Controller\SessionTestController::getSession' options: _auth: ['basic_auth'] requirements: _permission: 'administer site configuration' + +session_test.set_session: + path: '/session-test/set-session/{test_value}' + defaults: + _title: 'Set a session value using basic authentication' + _controller: '\Drupal\session_test\Controller\SessionTestController::setSession' + options: + _auth: ['basic_auth'] + converters: + test_value: '\s+' + requirements: + _permission: 'administer site configuration' diff --git a/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php b/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php index ccf3945..e1ebcf8 100644 --- a/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php +++ b/core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php @@ -149,8 +149,30 @@ public function traceHandler() { return new JsonResponse($trace); } + /** + * @param \Symfony\Component\HttpFoundation\Request $request + * The request object. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * A response object containing the session values and the user ID. + */ public function getSession(Request $request) { return new JsonResponse(['session' => $request->getSession()->all(), 'user' => $this->currentUser()->id()]); } + /** + * @param \Symfony\Component\HttpFoundation\Request $request + * The request object. + * @param string $test_value + * A session value. + * + * @return \Symfony\Component\HttpFoundation\JsonResponse + * A response object containing the session values and the user ID. + */ + public function setSession(Request $request, $test_value) { + $session = $request->getSession(); + $session->set('test_value', $test_value); + $session->save(); + return new JsonResponse(['session' => $session->all(), 'user' => $this->currentUser()->id()]); + } }