/** * @covers PPI\Framework\ServiceManager::createScopedServiceManager */ public function testCreateScopedServiceManager() { $this->serviceManager->setService('foo', 'bar'); $scopedServiceManager = $this->serviceManager->createScopedServiceManager(); $this->assertNotSame($this->serviceManager, $scopedServiceManager); $this->assertFalse($scopedServiceManager->has('foo', true, false)); $this->assertContains($this->serviceManager, $this->readAttribute($scopedServiceManager, 'peeringServiceManagers')); // test child scoped $childScopedServiceManager = $this->serviceManager->createScopedServiceManager(ServiceManager::SCOPE_CHILD); $this->assertContains($childScopedServiceManager, $this->readAttribute($this->serviceManager, 'peeringServiceManagers')); }