protected function onKernelViewIsNotRestRequest($method, GetResponseEvent $event) { $this->getVisitorDispatcherMock()->expects($this->never())->method('dispatch'); $this->getEventListener()->{$method}($event); }