From b853215b4c2d7ee36db4b560e3ee3ca3b1c7c369 Mon Sep 17 00:00:00 2001 From: KalimeroMK Date: Mon, 12 Oct 2026 23:49:59 +0200 Subject: [PATCH 1/2] Housekeeping: duplicated full stop, workflow typo, stale keywords - `MessageFailureException` appended a full stop to a message that already ends with one: `... does not exist..` - `bechmark.yml` / `name: bechmark`. - `gii` is the code generator, and there is no DB or Gearman adapter in the adapter list. --- .github/workflows/{bechmark.yml => benchmark.yml} | 2 +- composer.json | 3 --- src/Exception/MessageFailureException.php | 2 +- tests/Unit/WorkerTest.php | 4 ++-- 4 files changed, 4 insertions(+), 7 deletions(-) rename .github/workflows/{bechmark.yml => benchmark.yml} (98%) diff --git a/.github/workflows/bechmark.yml b/.github/workflows/benchmark.yml similarity index 98% rename from .github/workflows/bechmark.yml rename to .github/workflows/benchmark.yml index c3421912..129af85e 100644 --- a/.github/workflows/bechmark.yml +++ b/.github/workflows/benchmark.yml @@ -22,7 +22,7 @@ on: - 'psalm.xml' - 'tests/**' -name: bechmark +name: benchmark permissions: contents: read diff --git a/composer.json b/composer.json index 91ca93d6..4c4219f6 100644 --- a/composer.json +++ b/composer.json @@ -6,12 +6,9 @@ "yii", "queue", "async", - "gii", - "db", "redis", "rabbitmq", "beanstalk", - "gearman", "sqs" ], "license": "BSD-3-Clause", diff --git a/src/Exception/MessageFailureException.php b/src/Exception/MessageFailureException.php index 44d5aa99..406c2333 100644 --- a/src/Exception/MessageFailureException.php +++ b/src/Exception/MessageFailureException.php @@ -19,7 +19,7 @@ public function __construct( ) { $messageId = IdEnvelope::fromMessage($queueMessage)->getId(); $exceptionMessage = sprintf( - "Processing of message %s is stopped because of an exception:\n%s.", + "Processing of message %s is stopped because of an exception:\n%s", $messageId === null ? 'without ID' : "#$messageId", $previous->getMessage(), ); diff --git a/tests/Unit/WorkerTest.php b/tests/Unit/WorkerTest.php index adab4e2f..45169f58 100644 --- a/tests/Unit/WorkerTest.php +++ b/tests/Unit/WorkerTest.php @@ -64,13 +64,13 @@ public function testMessageFailWithDefinitionHandlerException(): void self::fail('Exception was not thrown.'); } catch (MessageFailureException $exception) { self::assertSame($exception::class, MessageFailureException::class); - self::assertSame($exception->getMessage(), "Processing of message without ID is stopped because of an exception:\nTest exception."); + self::assertSame($exception->getMessage(), "Processing of message without ID is stopped because of an exception:\nTest exception"); self::assertEquals(['test-data'], $exception->getQueueMessage()->getPayload()); } finally { $messages = $logger->getMessages(); $this->assertNotEmpty($messages); $this->assertStringContainsString( - "Processing of message without ID is stopped because of an exception:\nTest exception.", + "Processing of message without ID is stopped because of an exception:\nTest exception", $messages[1]['message'], ); } From 668144e5070bd73a3821fd86bcbf4fb2136fc53d Mon Sep 17 00:00:00 2001 From: KalimeroMK Date: Mon, 12 Oct 2026 23:55:43 +0200 Subject: [PATCH 2/2] Pass expected before actual in the rewritten assertion --- tests/Unit/WorkerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Unit/WorkerTest.php b/tests/Unit/WorkerTest.php index 45169f58..0eea359b 100644 --- a/tests/Unit/WorkerTest.php +++ b/tests/Unit/WorkerTest.php @@ -64,7 +64,7 @@ public function testMessageFailWithDefinitionHandlerException(): void self::fail('Exception was not thrown.'); } catch (MessageFailureException $exception) { self::assertSame($exception::class, MessageFailureException::class); - self::assertSame($exception->getMessage(), "Processing of message without ID is stopped because of an exception:\nTest exception"); + self::assertSame("Processing of message without ID is stopped because of an exception:\nTest exception", $exception->getMessage()); self::assertEquals(['test-data'], $exception->getQueueMessage()->getPayload()); } finally { $messages = $logger->getMessages();