Refatoring : Working state

This commit is contained in:
julien
2026-03-16 15:16:56 +01:00
parent 3ad3c3d0b7
commit aa00bec846
7 changed files with 16 additions and 43 deletions

View File

@@ -6,7 +6,8 @@ namespace Tests\Media;
use App\Media\Exception\FileTooLargeException;
use App\Media\Exception\StorageException;
use App\Media\MediaRepositoryInterface;
use App\Media\MediaService;
use App\Media\Application\MediaApplicationService as MediaService;
use App\Media\Infrastructure\LocalMediaStorage;
use App\Post\PostRepositoryInterface;
use PHPUnit\Framework\TestCase;
use Psr\Http\Message\StreamInterface;
@@ -23,7 +24,7 @@ final class MediaServiceEdgeCasesTest extends TestCase
$file = $this->createMock(UploadedFileInterface::class);
$file->method('getSize')->willReturn(null);
$service = new MediaService($repo, $postRepo, '/tmp', '/media', 1000);
$service = new MediaService($repo, $postRepo, new LocalMediaStorage('/tmp'), '/media', 1000);
$this->expectException(StorageException::class);
$service->store($file, 1);
@@ -41,7 +42,7 @@ final class MediaServiceEdgeCasesTest extends TestCase
$file->method('getSize')->willReturn(999999);
$file->method('getStream')->willReturn($stream);
$service = new MediaService($repo, $postRepo, '/tmp', '/media', 100);
$service = new MediaService($repo, $postRepo, new LocalMediaStorage('/tmp'), '/media', 100);
$this->expectException(FileTooLargeException::class);
$service->store($file, 1);