Alex\MailCatcher\Behat\MailCatcherContext::findMail PHP Method

findMail() protected method

This method is duplicated from MailCatcherTrait, for support in PHP 5.3
protected findMail ( $type, $value ) : Message
return Alex\MailCatcher\Message
    protected function findMail($type, $value)
    {
        $criterias = array($type => $value);
        $message = $this->getMailCatcherClient()->searchOne($criterias);
        if (null === $message) {
            throw new \InvalidArgumentException(sprintf('Unable to find a message with criterias "%s".', json_encode($criterias)));
        }
        return $message;
    }