feat: event listener sur MangaCreated pour ajouter les chapitres à la création

This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2025-02-11 18:28:30 +01:00
parent 879b8fa2dc
commit 73774f84ff
10 changed files with 83 additions and 24 deletions

View File

@@ -13,6 +13,7 @@ use App\Domain\Manga\Domain\Model\ValueObject\MangaTitle;
use App\Tests\Domain\Manga\Adapter\InMemoryMangaProvider;
use App\Tests\Domain\Manga\Adapter\InMemoryMangaRepository;
use App\Tests\Domain\Manga\Adapter\InMemoryImageProcessor;
use App\Tests\Shared\Adapter\InMemoryMessageBus;
use PHPUnit\Framework\TestCase;
class CreateMangaFromMangadexHandlerTest extends TestCase
@@ -21,7 +22,7 @@ class CreateMangaFromMangadexHandlerTest extends TestCase
private InMemoryMangaRepository $repository;
private InMemoryImageProcessor $imageProcessor;
private CreateMangaFromMangadexHandler $handler;
private InMemoryMessageBus $messageBus;
protected function setUp(): void
{
$manga = new Manga(
@@ -40,10 +41,12 @@ class CreateMangaFromMangadexHandlerTest extends TestCase
$this->provider = new InMemoryMangaProvider([$manga]);
$this->repository = new InMemoryMangaRepository();
$this->imageProcessor = new InMemoryImageProcessor();
$this->messageBus = new InMemoryMessageBus();
$this->handler = new CreateMangaFromMangadexHandler(
$this->provider,
$this->repository,
$this->imageProcessor
$this->imageProcessor,
$this->messageBus
);
}