You are here

public function TraceableEventDispatcherTest::testStopwatchStopControllerOnRequestEvent 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::testStopwatchStopControllerOnRequestEvent()

File

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

Class

TraceableEventDispatcherTest

Namespace

Symfony\Component\HttpKernel\Tests\Debug

Code

public function testStopwatchStopControllerOnRequestEvent() {
  $stopwatch = $this
    ->getMockBuilder('Symfony\\Component\\Stopwatch\\Stopwatch')
    ->setMethods(array(
    'isStarted',
    'stop',
    'stopSection',
  ))
    ->getMock();
  $stopwatch
    ->expects($this
    ->once())
    ->method('isStarted')
    ->will($this
    ->returnValue(true));
  $stopwatch
    ->expects($this
    ->once())
    ->method('stop');
  $stopwatch
    ->expects($this
    ->once())
    ->method('stopSection');
  $dispatcher = new TraceableEventDispatcher(new EventDispatcher(), $stopwatch);
  $kernel = $this
    ->getHttpKernel($dispatcher, function () {
    return new Response();
  });
  $request = Request::create('/');
  $kernel
    ->handle($request);
}