/** * @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()); }
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(); }