Esempio n. 1
0
 /**
  * @covers Zend\ServiceManager\ServiceManager::setAllowOverride
  * @covers Zend\ServiceManager\ServiceManager::getAllowOverride
  */
 public function testAllowOverride()
 {
     $this->assertFalse($this->serviceManager->getAllowOverride());
     $ret = $this->serviceManager->setAllowOverride(true);
     $this->assertSame($this->serviceManager, $ret);
     $this->assertTrue($this->serviceManager->getAllowOverride());
 }
Esempio n. 2
0
 public function createServer($name = 'default')
 {
     Console::overrideIsConsole(false);
     $configuration = $this->configuration;
     $smConfig = isset($configuration['service_manager']) ? $configuration['service_manager'] : array();
     $serviceManager = new ServiceManager(new ServiceManagerConfig($smConfig));
     $serviceManager->setService('ApplicationConfig', $configuration);
     $serviceManager->get('ModuleManager')->loadModules();
     $application = new Application($configuration, $serviceManager);
     $application->setServerOptions($this->options->getServer($name));
     $allow = $serviceManager->getAllowOverride();
     $serviceManager->setAllowOverride(true);
     $serviceManager->setService('application', $application);
     $serviceManager->setAllowOverride($allow);
     return $application->bootstrap();
 }