public function testNotMasterRequest() { $event = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent')->disableOriginalConstructor()->getMock(); $event->expects($this->never())->method('getRequest'); $event->expects($this->never())->method('getResponse'); $event->expects($this->once())->method('getRequestType')->will($this->returnValue(HttpKernelInterface::SUB_REQUEST)); $registry = $this->getMock('Doctrine\\Common\\Persistence\\ManagerRegistry'); $registry->expects($this->never())->method('getManagerForClass'); $titleService = $this->getMock('Oro\\Bundle\\NavigationBundle\\Provider\\TitleServiceInterface'); $listener = new ResponseHistoryListener($this->factory, $this->securityContext, $registry, $titleService); $listener->onResponse($event); }
public function testNotMasterRequest() { $event = $this->getMockBuilder('Symfony\\Component\\HttpKernel\\Event\\FilterResponseEvent')->disableOriginalConstructor()->getMock(); $event->expects($this->never())->method('getRequest'); $event->expects($this->never())->method('getResponse'); $event->expects($this->once())->method('getRequestType')->will($this->returnValue(HttpKernelInterface::SUB_REQUEST)); $em = $this->getMockBuilder('Doctrine\\ORM\\EntityManager')->disableOriginalConstructor()->getMock(); $em->expects($this->never())->method('getRepository'); $titleService = $this->getMock('Oro\\Bundle\\NavigationBundle\\Provider\\TitleServiceInterface'); $listener = new ResponseHistoryListener($this->factory, $this->tokenStorage, $em, $titleService); $listener->onResponse($event); }