/** * Run assertions and throw if they do not pass * * @param EmailMatcher[] $matchers * * @return \Ingenerator\Mailhook\Email[] emails that matched the assertion */ public function assert($matchers = array()) { $this->mailhook->refresh(); $mails = $this->filterer->filterEmails($this->mailhook->getEmails(), $matchers); $this->do_assert($mails, $matchers); return $mails; }
function its_get_emails_and_has_emails_are_empty_after_purge() { $this->given_dump_file(self::SINGLE_MAIL_DUMP); $this->subject->refresh(); $this->subject->purge(); $this->subject->shouldNotHaveEmails(); $this->subject->getEmails()->shouldBe(array()); }
/** * @param \Ingenerator\Mailhook\Mailhook $mailhook * @param \Ingenerator\Mailhook\EmailListFilterer $filterer */ function let($mailhook, $filterer) { $mailhook->refresh()->willReturn(NULL); $mailhook->getEmails()->willReturn(array()); $this->beConstructedWith($mailhook, $filterer); }