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