57 $this->mockReflectionService = $this->getMock(
'TYPO3\CMS\Extbase\Reflection\ReflectionService');
58 $this->mockObjectManager = $this->getMock(
'TYPO3\CMS\Extbase\Object\ObjectManagerInterface');
59 $this->mockContainer = $this->getMock(
'\TYPO3\CMS\Extbase\Object\Container\Container');
62 $this->
inject($this->converter,
'reflectionService', $this->mockReflectionService);
63 $this->
inject($this->converter,
'objectManager', $this->mockObjectManager);
64 $this->
inject($this->converter,
'objectContainer', $this->mockContainer);
71 $this->assertEquals(array(
'array'), $this->converter->getSupportedSourceTypes(),
'Source types do not match');
72 $this->assertEquals(
'object', $this->converter->getSupportedTargetType(),
'Target type does not match');
73 $this->assertEquals(0, $this->converter->getPriority(),
'Priority does not match');
82 array(
'TYPO3\\CMS\\Extbase\\Tests\\Fixture\\Entity', FALSE),
84 array(
'TYPO3\\CMS\\Extbase\\Tests\\Fixture\\ValueObject', FALSE),
86 array(
'stdClass', TRUE)
97 $this->assertEquals($expected, $this->converter->canConvertFrom(
'myInputData', $className));
104 $this->mockReflectionService->expects($this->any())->method(
'hasMethod')->with(
'TheTargetType',
'setThePropertyName')->will($this->returnValue(FALSE));
105 $this->mockReflectionService->expects($this->any())->method(
'getMethodParameters')->with(
'TheTargetType',
'__construct')->will($this->returnValue(array(
106 'thePropertyName' => array(
107 'type' =>
'TheTypeOfSubObject',
108 'elementType' => NULL
111 $this->mockContainer->expects($this->any())->method(
'getImplementationClassName')->will($this->returnValue(
'TheTargetType'));
114 $configuration->setTypeConverterOptions(
'TYPO3\CMS\Extbase\Property\TypeConverter\ObjectConverter', array());
115 $this->assertEquals(
'TheTypeOfSubObject', $this->converter->getTypeOfChildProperty(
'TheTargetType',
'thePropertyName', $configuration));
inject($target, $name, $dependency)
dataProviderForCanConvert()
getTypeOfChildPropertyShouldUseReflectionServiceToDetermineType()
canConvertFromReturnsTrueIfClassIsTaggedWithEntityOrValueObject($className, $expected)