Has two major working modes: 1. File Uploads by PHP In this case, the input array is expected to be a fresh file upload following the native PHP handling. The temporary upload file is then imported through the resource manager. To enable the handling of files that have already been uploaded earlier, the special field ['originallySubmittedResource'] is checked. If set, it is used to fetch a file that has already been uploaded even if no file has been actually uploaded in the current request. 2. Strings / arbitrary Arrays If the source - is an array and contains the key '__identity' the converter will find an existing resource with the given identity or continue and assign the given identity if CONFIGURATION_IDENTITY_CREATION_ALLOWED is set. - is a string looking like a SHA1 (40 characters [0-9a-f]) or - is an array and contains the key 'hash' with a value looking like a SHA1 (40 characters [0-9a-f]) the converter will look up an existing PersistentResource with that hash and return it if found. If that fails, the converter will try to import a file named like that hash from the configured CONFIGURATION_RESOURCE_LOAD_PATH. If no hash is given in an array source but the key 'data' is set, the content of that key is assumed a binary string and a PersistentResource representing this content is created and returned. The imported PersistentResource will be given a 'filename' if set in the source array in both cases (import from file or data).
Inheritance: extends Neos\Flow\Property\TypeConverter\AbstractTypeConverter
 /**
  * @test
  */
 public function convertFromReturnsAnErrorIfTheUploadedFileCantBeImported()
 {
     $this->inject($this->resourceTypeConverter, 'systemLogger', $this->createMock(SystemLoggerInterface::class));
     $source = ['tmp_name' => 'SomeFilename', 'error' => \UPLOAD_ERR_OK];
     $this->mockResourceManager->expects($this->once())->method('importUploadedResource')->with($source)->will($this->throwException(new Exception()));
     $actualResult = $this->resourceTypeConverter->convertFrom($source, PersistentResource::class);
     $this->assertInstanceOf(FlowError\Error::class, $actualResult);
 }