/** * @test */ public function getTypeOfChildPropertyShouldUseReflectionServiceToDetermineType() { $this->mockReflectionService->expects($this->any())->method('hasMethod')->with('TheTargetType', 'setThePropertyName')->will($this->returnValue(FALSE)); $this->mockReflectionService->expects($this->any())->method('getMethodParameters')->with('TheTargetType', '__construct')->will($this->returnValue(array('thePropertyName' => array('type' => 'TheTypeOfSubObject', 'elementType' => NULL)))); $configuration = new \TYPO3\FLOW3\Property\PropertyMappingConfiguration(); $configuration->setTypeConverterOptions('TYPO3\\FLOW3\\Property\\TypeConverter\\ObjectConverter', array()); $this->assertEquals('TheTypeOfSubObject', $this->converter->getTypeOfChildProperty('TheTargetType', 'thePropertyName', $configuration)); }
/** * All properties in the source array except __identity are sub-properties. * * @param mixed $source * @return array */ public function getSourceChildPropertiesToBeConverted($source) { if (is_string($source)) { return array(); } if (isset($source['__identity'])) { unset($source['__identity']); } return parent::getSourceChildPropertiesToBeConverted($source); }