Example #1
0
 /**
  * @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));
 }
 /**
  * @param array $typeConverterOptions
  * @return \TYPO3\FLOW3\Property\PropertyMappingConfiguration
  */
 protected function buildConfiguration($typeConverterOptions)
 {
     $configuration = new \TYPO3\FLOW3\Property\PropertyMappingConfiguration();
     $configuration->setTypeConverterOptions('TYPO3\\FLOW3\\Property\\TypeConverter\\PersistentObjectConverter', $typeConverterOptions);
     return $configuration;
 }