From f071df325d5a3943ce59f1f137c8ed2ff7c5edb0 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Wed, 27 Jul 2022 10:26:18 +0200 Subject: [PATCH] Fixed NotifyNewShortUrlToRabbitMqTest --- .../RabbitMq/NotifyNewShortUrlToRabbitMqTest.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/module/Core/test/EventDispatcher/RabbitMq/NotifyNewShortUrlToRabbitMqTest.php b/module/Core/test/EventDispatcher/RabbitMq/NotifyNewShortUrlToRabbitMqTest.php index ba735d6a..3bb46286 100644 --- a/module/Core/test/EventDispatcher/RabbitMq/NotifyNewShortUrlToRabbitMqTest.php +++ b/module/Core/test/EventDispatcher/RabbitMq/NotifyNewShortUrlToRabbitMqTest.php @@ -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(); }