- return new UploadedFile($this->getTestImageFilePath($testDataFileName), $fileName, 'image/png', 5238, null, true);
+ $imagePath = implode(DIRECTORY_SEPARATOR, [sys_get_temp_dir(), $imageFileName]);
+ $base64FilePath = $this->getTestImageFilePath($base64FileName);
+ $data = file_get_contents($base64FilePath);
+ $decoded = base64_decode($data);
+ file_put_contents($imagePath, $decoded);
+
+ return new UploadedFile($imagePath, $imageFileName, 'image/png', null, true);
+ }
+
+ /**
+ * Get a test image that can be uploaded.
+ */
+ protected function getTestImage(string $fileName, ?string $testDataFileName = null): UploadedFile
+ {
+ return new UploadedFile($this->getTestImageFilePath($testDataFileName), $fileName, 'image/png', null, true);