public function ProfilerListenerTest::testLegacyEventsWithoutRequestStack in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/http-kernel/Tests/EventListener/ProfilerListenerTest.php \Symfony\Component\HttpKernel\Tests\EventListener\ProfilerListenerTest::testLegacyEventsWithoutRequestStack()
Test to ensure BC without RequestStack.
@group legacy
File
- vendor/
symfony/ http-kernel/ Tests/ EventListener/ ProfilerListenerTest.php, line 30
Class
Namespace
Symfony\Component\HttpKernel\Tests\EventListenerCode
public function testLegacyEventsWithoutRequestStack() {
$profile = $this
->getMockBuilder('Symfony\\Component\\HttpKernel\\Profiler\\Profile')
->disableOriginalConstructor()
->getMock();
$profiler = $this
->getMockBuilder('Symfony\\Component\\HttpKernel\\Profiler\\Profiler')
->disableOriginalConstructor()
->getMock();
$profiler
->expects($this
->once())
->method('collect')
->will($this
->returnValue($profile));
$kernel = $this
->getMock('Symfony\\Component\\HttpKernel\\HttpKernelInterface');
$request = $this
->getMockBuilder('Symfony\\Component\\HttpFoundation\\Request')
->disableOriginalConstructor()
->getMock();
$response = $this
->getMockBuilder('Symfony\\Component\\HttpFoundation\\Response')
->disableOriginalConstructor()
->getMock();
$listener = new ProfilerListener($profiler);
$listener
->onKernelRequest(new GetResponseEvent($kernel, $request, Kernel::MASTER_REQUEST));
$listener
->onKernelResponse(new FilterResponseEvent($kernel, $request, Kernel::MASTER_REQUEST, $response));
$listener
->onKernelTerminate(new PostResponseEvent($kernel, $request, $response));
}