/** * @param \Ingenerator\Mailhook\EmailMatcher $matcher1 * @param \Ingenerator\Mailhook\EmailMatcher $matcher2 */ function it_describes_matchers_in_message($matcher1, $matcher2) { $matcher1->__toString()->willReturn('Containing "here"'); $matcher2->__toString()->willReturn('To test@ingenerator.com'); $this->beConstructedWith('Problem email', array($matcher1, $matcher2)); $this->subject->getMessage()->shouldMatch('/\\nMatchers: Containing "here", To test@ingenerator.com$/'); }
function it_is_an_email_matcher() { $this->subject->shouldHaveType('Ingenerator\\Mailhook\\EmailMatcher'); }
/** * @param \Ingenerator\Mailhook\EmailMatcher $yes_matcher * @param \Ingenerator\Mailhook\EmailMatcher $no_matcher */ function it_filters_emails_to_empty_array_when_one_matcher_matches_and_one_does_not($yes_matcher, $no_matcher) { $yes_matcher->matches(Argument::any())->willReturn(TRUE); $no_matcher->matches(Argument::any())->willReturn(FALSE); $this->subject->filterEmails(array(new DummyEmail()), array($yes_matcher, $no_matcher))->shouldBe(array()); }