Neos\Flow\Tests\Unit\ResourceManagement\ResourceTypeConverterTest::convertFromReturnsAnErrorIfTheUploadedFileCantBeImported PHP Method

convertFromReturnsAnErrorIfTheUploadedFileCantBeImported() public method

    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);
    }