/** * @test */ public function convertFromUsesAppropriatePropertyPopulationMethodsInOrderConstructorSetterPublic() { $convertedObject = $this->converter->convertFrom('irrelevant', \TYPO3\Flow\Tests\Functional\Property\Fixtures\TestClass::class, array('propertyMeantForConstructorUsage' => 'theValue', 'propertyMeantForSetterUsage' => 'theValue', 'propertyMeantForPublicUsage' => 'theValue'), new PropertyMappingConfiguration()); $this->assertEquals('theValue set via Constructor', ObjectAccess::getProperty($convertedObject, 'propertyMeantForConstructorUsage', true)); $this->assertEquals('theValue set via Setter', ObjectAccess::getProperty($convertedObject, 'propertyMeantForSetterUsage', true)); $this->assertEquals('theValue', ObjectAccess::getProperty($convertedObject, 'propertyMeantForPublicUsage', true)); }
/** * @test * @expectedException \TYPO3\Flow\Property\Exception\InvalidTargetException */ public function convertFromThrowsMeaningfulExceptionWhenTheTargetExpectsAnUnknownDependencyThatIsNotSpecifiedInTheSource() { $this->converter->convertFrom('irrelevant', \TYPO3\Flow\Tests\Functional\Property\Fixtures\TestClassWithThirdPartyClassConstructorInjection::class); }