Ejemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function setUp()
 {
     $serviceManager = \DoctrineMongoODMModuleTest\Doctrine\Util\ServiceManagerFactory::getServiceManager();
     /* @var $sharedEventManager \Zend\EventManager\SharedEventManagerInterface */
     $sharedEventManager = $serviceManager->get('SharedEventManager');
     /* @var $application \Zend\Mvc\Application */
     $application = $serviceManager->get('Application');
     $invocations = 0;
     $sharedEventManager = $application->getEventManager()->getSharedManager();
     $sharedEventManager->attach('doctrine', 'loadCli.post', function () use(&$invocations) {
         $invocations += 1;
     });
     $application->bootstrap();
     $this->entityManager = $serviceManager->get('doctrine.documentmanager.odm_default');
     $this->cli = $serviceManager->get('doctrine.cli');
     $this->assertSame(1, $invocations);
 }