diff --git a/src/Exception/NoKeyInPayloadException.php b/src/Exception/NoKeyInPayloadException.php deleted file mode 100644 index 27f91f2..0000000 --- a/src/Exception/NoKeyInPayloadException.php +++ /dev/null @@ -1,52 +0,0 @@ -expectedKey . '" in payload'; - } - - /** - * @infection-ignore-all - */ - public function getSolution(): ?string - { - return sprintf( - "We have successfully unserialized a message, but there was no expected key \"%s\". - There are the following keys in the message: %s. - You might want to change message's structure, or make your own implementation of %s, - which won't rely on this key in the message.", - $this->expectedKey, - implode(', ', array_keys($this->payload)), - MessageSerializerInterface::class - ); - } -} diff --git a/tests/Unit/FriendlyExceptionTest.php b/tests/Unit/FriendlyExceptionTest.php index 6e14fab..1257be4 100644 --- a/tests/Unit/FriendlyExceptionTest.php +++ b/tests/Unit/FriendlyExceptionTest.php @@ -5,21 +5,9 @@ namespace Yiisoft\Queue\AMQP\Tests\Unit; use Yiisoft\Queue\AMQP\Exception\ExchangeDeclaredException; -use Yiisoft\Queue\AMQP\Exception\NoKeyInPayloadException; final class FriendlyExceptionTest extends UnitTestCase { - public function testNoKeyInPayloadException(): void - { - $exception = new NoKeyInPayloadException( - 'test', - ['item1', 'item2'] - ); - - self::assertSame('No key "test" in payload', $exception->getName()); - $this->assertMatchesRegularExpression('/test/', $exception->getSolution()); - } - public function testExchangeDeclaredException(): void { $exception = new ExchangeDeclaredException();