mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-14 04:00:57 +03:00
Fixed NotifyNewShortUrlToRabbitMqTest
This commit is contained in:
parent
3c042c4011
commit
f071df325d
1 changed files with 6 additions and 1 deletions
|
@ -107,8 +107,12 @@ class NotifyNewShortUrlToRabbitMqTest extends TestCase
|
|||
public function printsDebugMessageInCaseOfError(Throwable $e): void
|
||||
{
|
||||
$shortUrlId = '123';
|
||||
$update = Update::forTopicAndPayload(Topic::NEW_SHORT_URL->value, []);
|
||||
$find = $this->em->find(ShortUrl::class, $shortUrlId)->willReturn(ShortUrl::withLongUrl(''));
|
||||
$publish = $this->helper->publishUpdate(Argument::cetera())->willThrow($e);
|
||||
$generateUpdate = $this->updatesGenerator->newShortUrlUpdate(Argument::type(ShortUrl::class))->willReturn(
|
||||
$update,
|
||||
);
|
||||
$publish = $this->helper->publishUpdate($update)->willThrow($e);
|
||||
|
||||
($this->listener)(new ShortUrlCreated($shortUrlId));
|
||||
|
||||
|
@ -117,6 +121,7 @@ class NotifyNewShortUrlToRabbitMqTest extends TestCase
|
|||
['e' => $e],
|
||||
)->shouldHaveBeenCalledOnce();
|
||||
$find->shouldHaveBeenCalledOnce();
|
||||
$generateUpdate->shouldHaveBeenCalledOnce();
|
||||
$publish->shouldHaveBeenCalledOnce();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue