public function RoutePreloaderTest::testOnRequestOnHtml in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/tests/Drupal/Tests/Core/Routing/RoutePreloaderTest.php \Drupal\Tests\Core\Routing\RoutePreloaderTest::testOnRequestOnHtml()
Tests onRequest on a html request.
File
- core/
tests/ Drupal/ Tests/ Core/ Routing/ RoutePreloaderTest.php, line 153 - Contains \Drupal\Tests\Core\Routing\RoutePreloaderTest.
Class
- RoutePreloaderTest
- @coversDefaultClass \Drupal\Core\Routing\RoutePreloader @group Routing
Namespace
Drupal\Tests\Core\RoutingCode
public function testOnRequestOnHtml() {
$event = $this
->getMockBuilder('\\Symfony\\Component\\HttpKernel\\Event\\KernelEvent')
->disableOriginalConstructor()
->getMock();
$request = new Request();
$request
->setRequestFormat('html');
$event
->expects($this
->any())
->method('getRequest')
->will($this
->returnValue($request));
$this->routeProvider
->expects($this
->once())
->method('preLoadRoutes')
->with([
'test2',
]);
$this->state
->expects($this
->once())
->method('get')
->with('routing.non_admin_routes')
->will($this
->returnValue(array(
'test2',
)));
$this->preloader
->onRequest($event);
}