test icon uploads
This commit is contained in:
parent
77dc4173b6
commit
0f3bb6de6b
4 changed files with 356 additions and 1 deletions
26
backend/tests/Fakes/FakeFileUploader.php
Normal file
26
backend/tests/Fakes/FakeFileUploader.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Fakes;
|
||||
|
||||
use App\Shared\Files\FileToUpload;
|
||||
use App\Shared\Files\FileUploader;
|
||||
|
||||
class FakeFileUploader implements FileUploader
|
||||
{
|
||||
/**
|
||||
* @var array<int, array{file: FileToUpload, folder: string}>
|
||||
*/
|
||||
public array $uploads = [];
|
||||
|
||||
public function upload(FileToUpload $file, string $folder): string
|
||||
{
|
||||
$this->uploads[] = ['file' => $file, 'folder' => $folder];
|
||||
|
||||
return $folder . '/fake-' . $file->getOriginalName();
|
||||
}
|
||||
|
||||
public function url(string $path): string
|
||||
{
|
||||
return 'https://test.local/storage/' . $path;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue