You are here

public function TraceableEventDispatcherTest::testStopwatchSections in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/Tests/Debug/TraceableEventDispatcherTest.php \Symfony\Component\HttpKernel\Tests\Debug\TraceableEventDispatcherTest::testStopwatchSections()

File

vendor/symfony/http-kernel/Tests/Debug/TraceableEventDispatcherTest.php, line 23

Class

TraceableEventDispatcherTest

Namespace

Symfony\Component\HttpKernel\Tests\Debug

Code

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.controller',
    'controller',
    'kernel.response',
    'kernel.terminate',
  ), array_keys($events));
}