diff --git a/core/tests/Drupal/Tests/Core/Routing/AcceptHeaderMatcherTest.php b/core/tests/Drupal/Tests/Core/Routing/AcceptHeaderMatcherTest.php index 9b2e277..6eacd0e 100644 --- a/core/tests/Drupal/Tests/Core/Routing/AcceptHeaderMatcherTest.php +++ b/core/tests/Drupal/Tests/Core/Routing/AcceptHeaderMatcherTest.php @@ -85,9 +85,6 @@ public function testAcceptFiltering($accept_header, $format, $included_route, $e /** * Confirms that the AcceptHeaderMatcher throws an exception for no-route. - * - * @expectedException \Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException - * @expectedExceptionMessage No route found for the specified formats application/json text/xml */ public function testNoRouteFound() { // Remove the sample routes that would match any method. @@ -100,9 +97,8 @@ public function testNoRouteFound() { $request = Request::create('path/two', 'GET'); $request->headers->set('Accept', 'application/json, text/xml;q=0.9'); $request->setRequestFormat('json'); + $this->setExpectedException(NotAcceptableHttpException::class, 'No route found for the specified formats application/json text/xml'); $this->matcher->filter($routes, $request); - $this->matcher->filter($routes, $request); - $this->fail('No exception was thrown.'); } }