public function testRouteScopeListenerIgnoresSymfonyControllers(): void
{ $listener =
$this->
getContainer()->
get(RouteScopeListener::
class);
$request =
$this->
createRequest('/api', 'api',
new AdminApiSource(null, null
));
$event =
$this->
createEvent($request);
/** @var ProfilerController $profilerController */
$profilerController =
$this->
getContainer()->
get('web_profiler.controller.profiler'
);
$event->
setController($profilerController->
panelAction(...
));
$listener->
checkScope($event);
} public function testRouteScopeListenerFailsHardWithoutAnnotation(): void
{ $listener =
$this->
getContainer()->
get(RouteScopeListener::
class);
$request =
$this->
createRequest('/api', 'api',
new AdminApiSource(null, null
));
$request->attributes->
remove(PlatformRequest::ATTRIBUTE_ROUTE_SCOPE
);