/** * Return the matches of a regex against the raw email * * @param Message $email * @param $regex * * @return array */ protected function grabMatchesFromEmail(Message $email, $regex) { $matches = []; preg_match($regex, $email->getBody()[0]->getBody(), $matches); $this->assertNotEmpty($matches, "No matches found for {$regex}"); return $matches; }