feat: ajout de la fonctionnalité de récupération des chapitres de manga, avec mise à jour de l'API et des composants pour gérer la récupération asynchrone des chapitres, ainsi que des améliorations dans la gestion des erreurs et des tests associés.
This commit is contained in:
parent
5a5569cf2c
commit
ee2a9b3750
@@ -30,9 +30,10 @@ class FetchMangaChaptersTest extends AbstractApiTestCase
|
||||
|
||||
public function testFetchChaptersForExistingManga(): void
|
||||
{
|
||||
$mangaId = 'manga-id';
|
||||
$externalId = 'manga-123';
|
||||
$manga = new Manga(
|
||||
new MangaId('manga-id'),
|
||||
new MangaId($mangaId),
|
||||
new MangaTitle('Test Manga'),
|
||||
new MangaSlug('test-manga'),
|
||||
'Description',
|
||||
@@ -48,7 +49,7 @@ class FetchMangaChaptersTest extends AbstractApiTestCase
|
||||
|
||||
static::createClient()->request('POST', '/api/manga/chapters/fetch', [
|
||||
'json' => [
|
||||
'externalId' => $externalId
|
||||
'mangaId' => $mangaId
|
||||
]
|
||||
]);
|
||||
|
||||
@@ -57,14 +58,14 @@ class FetchMangaChaptersTest extends AbstractApiTestCase
|
||||
$messages = $this->messageBus->getDispatchedMessages();
|
||||
$this->assertCount(1, $messages);
|
||||
$this->assertInstanceOf(FetchMangaChapters::class, $messages[0]);
|
||||
$this->assertEquals($externalId, $messages[0]->externalId);
|
||||
$this->assertEquals($mangaId, $messages[0]->mangaId);
|
||||
}
|
||||
|
||||
public function testFetchChaptersWithInvalidExternalId(): void
|
||||
public function testFetchChaptersWithInvalidMangaId(): void
|
||||
{
|
||||
$response = static::createClient()->request('POST', '/api/manga/chapters/fetch', [
|
||||
'json' => [
|
||||
'externalId' => ''
|
||||
'mangaId' => ''
|
||||
]
|
||||
]);
|
||||
|
||||
@@ -72,8 +73,8 @@ class FetchMangaChaptersTest extends AbstractApiTestCase
|
||||
$this->assertJsonContains([
|
||||
'violations' => [
|
||||
[
|
||||
'propertyPath' => 'externalId',
|
||||
'message' => 'This value should not be blank.'
|
||||
'propertyPath' => 'mangaId',
|
||||
'message' => 'L\'identifiant du manga est obligatoire'
|
||||
]
|
||||
]
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user