/** * 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_assert_method_returns_constructed_asserter() { $this->subject->assert()->shouldBeAnInstanceOf('Ingenerator\\Mailhook\\MailhookAsserter'); }
/** * @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); }