convertFrom() 공개 메소드

If it is a string it will be converted according to the configured string format.
public convertFrom ( mixed $source, string $targetType, array $convertedChildProperties = [], Neos\Flow\Property\PropertyMappingConfigurationInterface $configuration = null ) : array
$source mixed
$targetType string
$convertedChildProperties array
$configuration Neos\Flow\Property\PropertyMappingConfigurationInterface
리턴 array
 /**
  * @test
  * @dataProvider stringToArrayDataProvider
  */
 public function canConvertFromStringToArray($source, $expectedResult, $mappingConfiguration)
 {
     // Create a map of arguments to return values.
     $configurationValueMap = [];
     foreach ($mappingConfiguration as $setting => $value) {
         $configurationValueMap[] = [ArrayConverter::class, $setting, $value];
     }
     $propertyMappingConfiguration = $this->createMock(PropertyMappingConfiguration::class);
     $propertyMappingConfiguration->expects($this->any())->method('getConfigurationValue')->will($this->returnValueMap($configurationValueMap));
     $this->assertEquals($expectedResult, $this->converter->convertFrom($source, 'array', [], $propertyMappingConfiguration));
 }