/** * Sets up this test case * * @author Robert Lemke <*****@*****.**> * @author Karsten Dambekalns <*****@*****.**> */ public function setUp() { $this->mockObjectManager = $this->getMock('F3\\FLOW3\\Object\\ObjectManagerInterface'); $this->mockObjectFactory = $this->getMock('F3\\FLOW3\\Object\\ObjectFactoryInterface'); $this->mockReflectionService = $this->getMock('F3\\FLOW3\\Reflection\\ReflectionService'); $this->mockReflectionService->expects($this->any())->method('getPropertyNamesByTag')->will($this->returnValue(array())); $this->objectBuilder = new \F3\FLOW3\Object\ObjectBuilder(); $this->objectBuilder->injectObjectManager($this->mockObjectManager); $this->objectBuilder->injectObjectFactory($this->mockObjectFactory); $this->objectBuilder->injectReflectionService($this->mockReflectionService); }
/** * Injects the Reflection Service * * The singleton object registry and object builder must have been injected before the Reflection Service * can be injected. * * This method will usually be called twice during one boot sequence: The first time a preliminary * reflection service is injected which is yet uninitialized and does not provide caching. After * the most important FLOW3 objects have been registered, the final reflection service is injected, * this time with caching. * * @param \F3\FLOW3\Reflection\ReflectionService $reflectionService The Reflection Service * @return void * @author Robert Lemke <*****@*****.**> */ public function injectReflectionService(\F3\FLOW3\Reflection\ReflectionService $reflectionService) { if (!is_object($this->singletonObjectsRegistry) && !is_object($this->objectBuilder)) { throw new \F3\FLOW3\Object\Exception\UnresolvedDependenciesException('No Object Registry or Object Builder has been injected into the Object Manager', 1231252863); } $this->reflectionService = $reflectionService; if (!isset($this->registeredObjects['F3\\FLOW3\\Reflection\\ReflectionService'])) { $this->registeredObjects['F3\\FLOW3\\Reflection\\ReflectionService'] = 'f3\\flow3\\reflection\\reflectionservice'; $this->registeredClasses['F3\\FLOW3\\Reflection\\ReflectionService'] = 'F3\\FLOW3\\Reflection\\ReflectionService'; $this->objectConfigurations['F3\\FLOW3\\Reflection\\ReflectionService'] = new \F3\FLOW3\Object\Configuration\Configuration('F3\\FLOW3\\Reflection\\ReflectionService'); } $this->singletonObjectsRegistry->putObject('F3\\FLOW3\\Reflection\\ReflectionService', $this->reflectionService); $this->objectBuilder->injectReflectionService($this->reflectionService); }