test icon uploads

This commit is contained in:
Yisroel Baum 2026-06-02 10:17:21 +03:00
parent 77dc4173b6
commit 0f3bb6de6b
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
4 changed files with 356 additions and 1 deletions

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