From ef075fb0ce108e9b01a1e5fd6e0ce85f627f60bc Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Wed, 12 Apr 2023 18:36:28 +0200 Subject: [PATCH] Fix test when CLI output viewport is too narrow --- .../CLI/test/Command/ShortUrl/CreateShortUrlCommandTest.php | 6 +++--- module/Core/test/ShortUrl/UrlShortenerTest.php | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/module/CLI/test/Command/ShortUrl/CreateShortUrlCommandTest.php b/module/CLI/test/Command/ShortUrl/CreateShortUrlCommandTest.php index 28e3ec21..fd474007 100644 --- a/module/CLI/test/Command/ShortUrl/CreateShortUrlCommandTest.php +++ b/module/CLI/test/Command/ShortUrl/CreateShortUrlCommandTest.php @@ -69,7 +69,7 @@ class CreateShortUrlCommandTest extends TestCase self::assertEquals(ExitCodes::EXIT_SUCCESS, $this->commandTester->getStatusCode()); self::assertStringContainsString('stringified_short_url', $output); - self::assertStringNotContainsString('but the real-time updates cannot be notified', $output); + self::assertStringNotContainsString('but the real-time updates cannot', $output); } #[Test] @@ -195,11 +195,11 @@ class CreateShortUrlCommandTest extends TestCase public static function provideDispatchBehavior(): iterable { $containsAssertion = static fn (string $output) => self::assertStringContainsString( - 'but the real-time updates cannot be notified', + 'but the real-time updates cannot', $output, ); $doesNotContainAssertion = static fn (string $output) => self::assertStringNotContainsString( - 'but the real-time updates cannot be notified', + 'but the real-time updates cannot', $output, ); diff --git a/module/Core/test/ShortUrl/UrlShortenerTest.php b/module/Core/test/ShortUrl/UrlShortenerTest.php index cf1691ac..a442abb3 100644 --- a/module/Core/test/ShortUrl/UrlShortenerTest.php +++ b/module/Core/test/ShortUrl/UrlShortenerTest.php @@ -65,7 +65,7 @@ class UrlShortenerTest extends TestCase $result = $this->urlShortener->shorten($meta); $thereIsError = false; - $result->onEventDispatchingError(function () use (&$thereIsError) { + $result->onEventDispatchingError(function () use (&$thereIsError): void { $thereIsError = true; }); @@ -75,7 +75,8 @@ class UrlShortenerTest extends TestCase public static function provideDispatchBehavior(): iterable { - yield 'no dispatch error' => [false, static function (): void {}]; + yield 'no dispatch error' => [false, static function (): void { + }]; yield 'dispatch error' => [true, static function (): void { throw new ServiceNotFoundException(); }];