/** * @test * @author Robert Lemke <*****@*****.**> */ public function objectExistsReturnsCorrectResult() { $originalObject = new \F3\FLOW3\Fixture\DummyClass(); $this->assertFalse($this->objectRegistry->objectExists('DummyObject'), 'objectExists() did not return FALSE although the object should not exist yet.'); $this->objectRegistry->putObject('DummyObject', $originalObject); $this->assertTrue($this->objectRegistry->objectExists('DummyObject'), 'objectExists() did not return TRUE although the object should exist.'); }
/** * Unregisters the specified object * * @param string $objectName The explicit object name * @return void * @author Robert Lemke <*****@*****.**> * @throws \F3\FLOW3\Object\Exception\UnknownObjectException if the specified object has not been registered before * @api */ public function unregisterObject($objectName) { if (!$this->isObjectRegistered($objectName)) { throw new \F3\FLOW3\Object\Exception\UnknownObjectException('Object "' . $objectName . '" is not registered.', 1167473433); } if ($this->singletonObjectsRegistry->objectExists($objectName)) { $this->singletonObjectsRegistry->removeObject($objectName); } unset($this->registeredClasses[$this->objectConfigurations[$objectName]->getClassName()]); unset($this->registeredObjects[$objectName]); unset($this->objectConfigurations[$objectName]); }