code()); } public function test_from_message_returns_message(): void { $message = new class ('some message') extends RuntimeException implements Message { }; self::assertSame($message, ThrowableMessage::from($message)); } public function test_from_throwable_returns_message(): void { $message = new RuntimeException('some message', 1337); $throwableMessage = ThrowableMessage::from($message); self::assertSame('some message', (string)$throwableMessage); self::assertSame('1337', $throwableMessage->code()); // @phpstan-ignore-line } }