protected functionmatches($message) : bool {
if (RawMessage::class === $message::class || Message::class === $message::class) {
thrownew\LogicException('Unable to test a message text body on a RawMessage or Message instance.');
}
returnstr_contains($message->getTextBody(), $this->expectedText);
}