/**
  * @param  \Oro\Bundle\NavigationBundle\Entity\Builder\ItemFactory   $factory
  * @param  \Symfony\Component\Security\Core\SecurityContextInterface $securityContext
  * @param  \Doctrine\ORM\EntityManager                               $entityManager
  *
  * @return ResponseHistoryListener
  */
 private function getListener($factory, $securityContext, $entityManager)
 {
     $registry = $this->getMock('Doctrine\\Common\\Persistence\\ManagerRegistry');
     $registry->expects($this->once())->method('getManagerForClass')->with('Oro\\Bundle\\NavigationBundle\\Entity\\NavigationHistoryItem')->will($this->returnValue($entityManager));
     $listener = new ResponseHistoryListener($factory, $securityContext, $registry, $this->getTitleService());
     $listener->setHistoryItemEntityFQCN('Oro\\Bundle\\NavigationBundle\\Entity\\NavigationHistoryItem');
     $listener->setUserEntityFQCN('Oro\\Bundle\\UserBundle\\Entity\\User');
     $listener->setNavigationHistoryItemType('history');
     return $listener;
 }