/**
  * Create an instance of EventManagerProxy
  * 
  * @param ServiceLocatorInterface $serviceLocator
  * 
  * @return EventManagerProxy
  */
 public function createService(ServiceLocatorInterface $serviceLocator)
 {
     $proxy = new EventManagerProxy();
     $em = new EventManager();
     $em->setSharedManager($serviceLocator->get('SharedEventManager'));
     $proxy->setEventManager($em);
     return $proxy;
 }
 public function testRemoveSubscriber()
 {
     $subscriber = new PostPersistEventSubscriberMock();
     $this->eventManagerProxy->addSubscriber($subscriber);
     $this->eventManagerProxy->removeSubscriber($subscriber);
     $this->eventManagerProxy->dispatch(PostPersistEvent::NAME, $this->getPostPersistEvent());
     $this->assertFalse($subscriber->wasCalled());
 }