$onlyException = true;
$listener =
new ProfilerListener($profiler,
$requestStack, null,
$onlyException);
// main request
$listener->
onKernelResponse(new ResponseEvent($kernel,
$mainRequest, Kernel::MAIN_REQUEST,
$response));
// sub request
$listener->
onKernelException(new ExceptionEvent($kernel,
$subRequest, Kernel::SUB_REQUEST,
new HttpException(404
)));
$listener->
onKernelResponse(new ResponseEvent($kernel,
$subRequest, Kernel::SUB_REQUEST,
$response));
$listener->
onKernelTerminate(new TerminateEvent($kernel,
$mainRequest,
$response));
} /**
* @dataProvider collectRequestProvider
*/
public function testCollectParameter(Request
$request, ?bool
$enable) { $profile =
new Profile('token'
);
$profiler =
$this->
createMock(Profiler::
class);
$profiler->
expects($this->
once())