diff --git a/core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php b/core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php index 7973f08..84fe421 100644 --- a/core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php +++ b/core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php @@ -92,7 +92,7 @@ public function onException(GetResponseForExceptionEvent $event) { $method = 'on' . $exception->getStatusCode(); // Keep just the leading number of the status code to produce either a // on400 or a 500 method callback. - $method_fallback = 'on' . (int) ($exception->getStatusCode() / 100) . '00'; + $method_fallback = 'on' . floor($exception->getStatusCode() / 100) . '00'; // We want to allow the method to be called and still not set a response // if it has additional filtering logic to determine when it will apply. // It is therefore the method's responsibility to set the response on the diff --git a/core/modules/rest/src/Tests/AuthTest.php b/core/modules/rest/src/Tests/AuthTest.php index 08db9ab..3246ba1 100644 --- a/core/modules/rest/src/Tests/AuthTest.php +++ b/core/modules/rest/src/Tests/AuthTest.php @@ -34,7 +34,7 @@ public function testRead() { // Try to read the resource as an anonymous user, which should not work. $this->httpRequest($entity->urlInfo()->setRouteParameter('_format', $this->defaultFormat), 'GET'); $this->assertResponse('401', 'HTTP response code is 401 when the request is not authenticated and the user is anonymous.'); - $this->assertRaw(json_encode(['message' => 'A fatal error occurred: No authentication credentials provided.'])); + $this->assertRaw(json_encode(['message' => 'No authentication credentials provided.'])); // Ensure that cURL settings/headers aren't carried over to next request. unset($this->curlHandle);