mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Fixed NotifyNewShortUrlToRabbitMqTest
This commit is contained in:
parent
3c042c4011
commit
f071df325d
@ -107,8 +107,12 @@ class NotifyNewShortUrlToRabbitMqTest extends TestCase
|
|||||||
public function printsDebugMessageInCaseOfError(Throwable $e): void
|
public function printsDebugMessageInCaseOfError(Throwable $e): void
|
||||||
{
|
{
|
||||||
$shortUrlId = '123';
|
$shortUrlId = '123';
|
||||||
|
$update = Update::forTopicAndPayload(Topic::NEW_SHORT_URL->value, []);
|
||||||
$find = $this->em->find(ShortUrl::class, $shortUrlId)->willReturn(ShortUrl::withLongUrl(''));
|
$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));
|
($this->listener)(new ShortUrlCreated($shortUrlId));
|
||||||
|
|
||||||
@ -117,6 +121,7 @@ class NotifyNewShortUrlToRabbitMqTest extends TestCase
|
|||||||
['e' => $e],
|
['e' => $e],
|
||||||
)->shouldHaveBeenCalledOnce();
|
)->shouldHaveBeenCalledOnce();
|
||||||
$find->shouldHaveBeenCalledOnce();
|
$find->shouldHaveBeenCalledOnce();
|
||||||
|
$generateUpdate->shouldHaveBeenCalledOnce();
|
||||||
$publish->shouldHaveBeenCalledOnce();
|
$publish->shouldHaveBeenCalledOnce();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user