Ejemplo n.º 1
0
 private function getCrawler(Message $message)
 {
     if (!class_exists('Symfony\\Component\\DomCrawler\\Crawler')) {
         throw new \RuntimeException('Can\'t crawl HTML: Symfony DomCrawler component is missing from autoloading.');
     }
     return new Crawler($message->getPart('text/html')->getContent());
 }
 /**
  * Asserts whether email body contains particular (plain) text
  *
  * @param string $text Text to look for
  * @param \Alex\MailCatcher\Message $emailMessage   Message sent
  * @param string $message What to say if it fails
  * @param boolean $ignoreCase Whether to do case sensitive search
  */
 public static function assertEmailBodyContains($text, \Alex\MailCatcher\Message $emailMessage, $message, $ignoreCase = false)
 {
     $content = $emailMessage->getPart('text/plain')->getContent();
     self::assertContains($text, $content, $message, $ignoreCase);
 }