public function testStopwatchSections() {
$dispatcher = new TraceableEventDispatcher(new EventDispatcher(), $stopwatch = new Stopwatch());
$kernel = $this
->getHttpKernel($dispatcher, function () {
return new Response();
});
$request = Request::create('/');
$response = $kernel
->handle($request);
$kernel
->terminate($request, $response);
$events = $stopwatch
->getSectionEvents($response->headers
->get('X-Debug-Token'));
$this
->assertEquals(array(
'__section__',
'kernel.request',
'kernel.request.loading',
'kernel.controller',
'kernel.controller.loading',
'controller',
'kernel.response',
'kernel.response.loading',
'kernel.terminate',
'kernel.terminate.loading',
), array_keys($events));
}