feat: firsts unit tests for ScrapeChapterHandler.php
This commit is contained in:
parent
21fcdd1084
commit
89570ad951
23
tests/Domain/Scraping/Adapter/InMemoryEventBus.php
Normal file
23
tests/Domain/Scraping/Adapter/InMemoryEventBus.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Tests\Domain\Scraping\Adapter;
|
||||
|
||||
use Symfony\Component\Messenger\Envelope;
|
||||
use Symfony\Component\Messenger\MessageBusInterface;
|
||||
|
||||
class InMemoryEventBus implements MessageBusInterface
|
||||
{
|
||||
private array $dispatchedMessages = [];
|
||||
|
||||
public function dispatch(object $message, array $stamps = []): Envelope
|
||||
{
|
||||
$this->dispatchedMessages[] = $message;
|
||||
|
||||
return new Envelope($message);
|
||||
}
|
||||
|
||||
public function getDispatchedMessages(): array
|
||||
{
|
||||
return $this->dispatchedMessages;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user