/**
  * @test
  * @author Robert Lemke <*****@*****.**>
  */
 public function propertiesOfTypeObjectCanSpecifyAdditionalObjectConfigurationOptions()
 {
     $configurationArray = array();
     $configurationArray['properties']['theProperty']['object']['name'] = 'Foo';
     $configurationArray['properties']['theProperty']['object']['className'] = __CLASS__;
     $propertyObjectConfiguration = new \F3\FLOW3\Object\Configuration\Configuration('Foo', __CLASS__);
     $propertyObjectConfiguration->setConfigurationSourceHint(__CLASS__ . ' / property "theProperty"');
     $objectConfiguration = new \F3\FLOW3\Object\Configuration\Configuration('TestObject', 'TestObject');
     $objectConfiguration->setProperty(new \F3\FLOW3\Object\Configuration\ConfigurationProperty('theProperty', $propertyObjectConfiguration, \F3\FLOW3\Object\Configuration\ConfigurationProperty::PROPERTY_TYPES_OBJECT));
     $builtObjectConfiguration = \F3\FLOW3\Object\Configuration\ConfigurationBuilder::buildFromConfigurationArray('TestObject', $configurationArray, __CLASS__);
     $this->assertEquals($objectConfiguration, $builtObjectConfiguration);
 }
 /**
  * @test
  * @author Robert Lemke <*****@*****.**>
  */
 public function getObjectPassesAdditionalArgumentsToTheObjectBuilderWhenItCreatesANewSingletonObject()
 {
     $someObject = new \ArrayObject();
     $arguments = array(1 => new \F3\FLOW3\Object\Configuration\ConfigurationArgument(1, 'arg1', \F3\FLOW3\Object\Configuration\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE), 2 => new \F3\FLOW3\Object\Configuration\ConfigurationArgument(2, $someObject, \F3\FLOW3\Object\Configuration\ConfigurationArgument::ARGUMENT_TYPES_STRAIGHTVALUE));
     $className = 'SomeClass' . uniqid();
     eval('class ' . $className . ' {}');
     $objectConfiguration = new \F3\FLOW3\Object\Configuration\Configuration($className);
     $objectConfiguration->setConfigurationSourceHint('F3\\FLOW3\\Object\\ObjectManager');
     $mockObjectBuilder = $this->getMock('F3\\FLOW3\\Object\\ObjectBuilder');
     $mockObjectBuilder->expects($this->once())->method('createObject')->with($className, $objectConfiguration, $arguments)->will($this->returnValue(new $className()));
     $mockSingletonObjectsRegistry = $this->getMock('F3\\FLOW3\\Object\\TransientRegistry');
     $mockSingletonObjectsRegistry->expects($this->once())->method('objectExists')->with($className)->will($this->returnValue(FALSE));
     $objectManager = new \F3\FLOW3\Object\ObjectManager();
     $objectManager->injectObjectBuilder($mockObjectBuilder);
     $objectManager->injectObjectFactory($this->getMock('F3\\FLOW3\\Object\\ObjectFactoryInterface'));
     $objectManager->injectSingletonObjectsRegistry($mockSingletonObjectsRegistry);
     $objectManager->injectReflectionService($this->getMock('F3\\FLOW3\\Reflection\\ReflectionService'));
     $objectManager->registerObject($className);
     $objectManager->getObject($className, 'arg1', $someObject);
 }