Merge pull request #35 from jeffreyguo/pulls/test-mailer-update

Get the latest email from the email
This commit is contained in:
Ingo Schommer 2014-04-30 17:53:15 +12:00
commit 68524346c6

View File

@ -80,7 +80,10 @@ class TestMailer extends \Mailer {
*/
public function findEmail($to = null, $from = null, $subject = null, $content = null) {
$matches = $this->findEmails($to, $from, $subject, $content);
return $matches ? $matches[0] : null;
//got the count of matches emails
$emailCount = count($matches);
//get the last(latest) one
return $matches ? $matches[$emailCount-1] : null;
}
/**