public static setInstance ( |
||
$registry | An object instance of type Registry, or a subclass. | |
return | void |
public static function setInstance(Registry $registry)
{
if (self::$registry !== null) {
throw new RuntimeException('Registry is already initialized');
}
self::$registry = $registry;
}
/** * Test * * @return void */ public function testSetInstanceWithRegistryAlreadyInitialized() { $this->setExpectedException('RuntimeException'); $this->object->setInstance(new Registry()); }