/** * Tests that the listener does nothing if the request is a fragment. */ public function testWithFragment() { $this->framework->expects($this->any())->method('isInitialized')->willReturn(true); $listener = new AddToSearchIndexListener($this->framework); $event = $this->mockPostResponseEvent('_fragment/foo/bar'); $event->expects($this->never())->method('getResponse'); $listener->onKernelTerminate($event); }