public function text() { if (!$this->hasText()) { throw new MailCatcherException('This message has no text body.'); } return $this->mailCatcher->messageText($this->id); }
function it_should_return_its_plain_body() { $this->mailCatcher->message('id')->willReturn(['formats' => ['plain']]); $this->mailCatcher->messageText('id')->willReturn('body'); $this->text()->shouldReturn('body'); }