public function testInstanceManagerCanPersistInstances()
 {
     $im = new InstanceManager();
     $obj = new TestAsset\BasicClass();
     $im->addSharedInstance($obj, 'ZendTest\\Di\\TestAsset\\BasicClass');
     $this->assertTrue($im->hasSharedInstance('ZendTest\\Di\\TestAsset\\BasicClass'));
     $this->assertSame($obj, $im->getSharedInstance('ZendTest\\Di\\TestAsset\\BasicClass'));
 }
 /**
  * Determine if we have a shared instance by class or alias
  *
  * @param $classOrAlias
  * @return bool
  */
 public function hasSharedInstance($classOrAlias)
 {
     return $this->serviceLocator->has($classOrAlias) || $this->diInstanceManager->hasSharedInstance($classOrAlias);
 }
 /**
  * Determine if we have a shared instance by class or alias
  *
  * @param $classOrAlias
  * @return bool
  */
 public function hasSharedInstance($classOrAlias)
 {
     return $this->container->has($classOrAlias) || $this->diInstanceManager->hasSharedInstance($classOrAlias);
 }