Example #1
0
 function test_singleton_duplicate_binding()
 {
     try {
         $this->injector->fork([__NAMESPACE__ . '\\DuplicateModule'])->getInstance(__NAMESPACE__ . '\\DuplicateModule');
         $this->fail('Duplicate binding should raise an exception');
     } catch (\LogicException $e) {
     }
 }
Example #2
0
 /**
  * Create an injector
  *
  * @param array $modules
  * @return Injector
  */
 public function createInjector(array $modules = [])
 {
     $reflection = ReflectionImpl::create($this->cache);
     return InjectorImpl::create(array_merge([new SpotModule($reflection, $this->storage, $this->cache, $this->isDebug(), $this->dump), "Spot\\Domain\\DomainModule"], $modules), $reflection, $this->storage, $this->logger);
 }