public function RoutePreloaderTest::testOnRequestNonHtml in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/Tests/Core/Routing/RoutePreloaderTest.php \Drupal\Tests\Core\Routing\RoutePreloaderTest::testOnRequestNonHtml()
Tests onRequest on a non html request.
File
- core/
tests/ Drupal/ Tests/ Core/ Routing/ RoutePreloaderTest.php, line 141
Class
- RoutePreloaderTest
- @coversDefaultClass \Drupal\Core\Routing\RoutePreloader @group Routing
Namespace
Drupal\Tests\Core\RoutingCode
public function testOnRequestNonHtml() {
$event = $this
->getMockBuilder('\\Symfony\\Component\\HttpKernel\\Event\\KernelEvent')
->disableOriginalConstructor()
->getMock();
$request = new Request();
$request
->setRequestFormat('non-html');
$event
->expects($this
->any())
->method('getRequest')
->will($this
->returnValue($request));
$this->routeProvider
->expects($this
->never())
->method('getRoutesByNames');
$this->state
->expects($this
->never())
->method('get');
$this->preloader
->onRequest($event);
}