feat: ajout de la gestion des URL d'image et de miniature dans les réponses des mangas, avec mise à jour des classes et des tests associés
This commit is contained in:
parent
6ea24deacf
commit
7051bf5274
@@ -7,6 +7,7 @@ use App\Domain\Manga\Application\QueryHandler\GetMangaByIdHandler;
|
||||
use App\Domain\Manga\Domain\Exception\MangaNotFoundException;
|
||||
use App\Domain\Manga\Domain\Model\Manga;
|
||||
use App\Domain\Manga\Domain\Model\ValueObject\ExternalId;
|
||||
use App\Domain\Manga\Domain\Model\ValueObject\ImageUrls;
|
||||
use App\Domain\Manga\Domain\Model\ValueObject\MangaId;
|
||||
use App\Domain\Manga\Domain\Model\ValueObject\MangaSlug;
|
||||
use App\Domain\Manga\Domain\Model\ValueObject\MangaTitle;
|
||||
@@ -36,17 +37,19 @@ class GetMangaByIdHandlerTest extends TestCase
|
||||
{
|
||||
// Arrange
|
||||
$manga = new Manga(
|
||||
new MangaId('123'),
|
||||
new MangaTitle('One Piece'),
|
||||
new MangaSlug('one-piece'),
|
||||
'Description test',
|
||||
'Eiichiro Oda',
|
||||
1997,
|
||||
['action', 'adventure'],
|
||||
'ongoing',
|
||||
new ExternalId('external-123'),
|
||||
'http://example.com/image.jpg',
|
||||
4.5
|
||||
id: new MangaId('123'),
|
||||
title: new MangaTitle('One Piece'),
|
||||
slug: new MangaSlug('one-piece'),
|
||||
description: 'Description test',
|
||||
author: 'Eiichiro Oda',
|
||||
publicationYear: 1997,
|
||||
genres: ['action', 'adventure'],
|
||||
status: 'ongoing',
|
||||
externalId: new ExternalId('external-123'),
|
||||
imageUrl: 'http://example.com/image.jpg',
|
||||
rating: 4.5,
|
||||
imageUrls: new ImageUrls('http://example.com/image.jpg', 'http://example.com/thumbnail.jpg'),
|
||||
createdAt: new \DateTimeImmutable()
|
||||
);
|
||||
$this->repository->save($manga);
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ use App\Domain\Manga\Application\Query\GetMangaBySlug;
|
||||
use App\Domain\Manga\Application\QueryHandler\GetMangaBySlugHandler;
|
||||
use App\Domain\Manga\Domain\Exception\MangaNotFoundException;
|
||||
use App\Domain\Manga\Domain\Model\Manga;
|
||||
use App\Domain\Manga\Domain\Model\ValueObject\ImageUrls;
|
||||
use App\Domain\Manga\Domain\Model\ValueObject\MangaId;
|
||||
use App\Domain\Manga\Domain\Model\ValueObject\MangaSlug;
|
||||
use App\Domain\Manga\Domain\Model\ValueObject\MangaTitle;
|
||||
@@ -37,6 +38,8 @@ class GetMangaBySlugHandlerTest extends TestCase
|
||||
status: 'ongoing',
|
||||
externalId: null,
|
||||
imageUrl: 'https://example.com/image.jpg',
|
||||
imageUrls: new ImageUrls('https://example.com/image.jpg', 'https://example.com/thumbnail.jpg'),
|
||||
|
||||
rating: 4.5
|
||||
);
|
||||
$this->repository->save($manga);
|
||||
|
||||
Reference in New Issue
Block a user