You are here

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

File

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

Class

TraceableEventDispatcherTest

Namespace

Symfony\Component\HttpKernel\Tests\Debug

Code

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