PHPSpec\Matcher\Matcher::supports PHP Method

supports() public method

Checks if matcher supports provided subject and matcher name.
public supports ( string $name, mixed $subject, array $arguments ) : boolean
$name string
$subject mixed
$arguments array
return boolean
    public function supports($name, $subject, array $arguments);

Usage Example

Ejemplo n.º 1
0
 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);
 }