public function testRequestEvent(): void
{ $request =
new Request();
$request->attributes->
set('_route', 'frontend.home.page'
);
$event =
new RequestEvent($this->
createMock(Kernel::
class),
$request, HttpKernelInterface::MAIN_REQUEST
);
$listener =
$this->
getMockBuilder(CallableClass::
class)->
getMock();
$listener->
expects(static::
once())->
method('__invoke'
);
$dispatcher =
new EventDispatcher();
$dispatcher->
addListener('frontend.home.page.request',
$listener);
$subscriber =
new RouteEventSubscriber($dispatcher);
$subscriber->
request($event);
} public function testResponseEvent(): void
{ $request =
new Request();
$request->attributes->
set('_route', 'frontend.home.page'
);