function it_calls_a_negative_match_on_matcher(Matcher $matcher) { $alias = 'somealias'; $subject = 'subject'; $arguments = array(); $matcher->negativeMatch($alias, $subject, $arguments)->shouldBeCalled(); $this->match($alias, $subject, $arguments); }
function it_searches_matchers_by_their_priority(Matcher $matcher1, Matcher $matcher2) { $matcher1->getPriority()->willReturn(2); $matcher1->supports('startWith', 'hello, world', array('hello'))->willReturn(true); $matcher2->getPriority()->willReturn(5); $matcher2->supports('startWith', 'hello, world', array('hello'))->willReturn(true); $this->add($matcher1); $this->add($matcher2); $this->find('startWith', 'hello, world', array('hello'))->shouldReturn($matcher2); }
/** * @param string $alias * @param mixed $subject * @param array $arguments * * @return mixed */ public function match($alias, $subject, array $arguments = array()) { return $this->matcher->negativeMatch($alias, $subject, $arguments); }