PhpSpec\Runner\MatcherManager::find PHP Метод

find() публичный Метод

public find ( string $keyword, mixed $subject, array $arguments ) : PhpSpec\Matcher\Matcher
$keyword string
$subject mixed
$arguments array
Результат PhpSpec\Matcher\Matcher
    public function find($keyword, $subject, array $arguments)
    {
        foreach ($this->matchers as $matcher) {
            if (true === $matcher->supports($keyword, $subject, $arguments)) {
                return $matcher;
            }
        }
        throw new MatcherNotFoundException(sprintf('No %s(%s) matcher found for %s.', $this->presenter->presentString($keyword), $this->presenter->presentValue($arguments), $this->presenter->presentValue($subject)), $keyword, $subject, $arguments);
    }

Usage Example

Пример #1
0
 function it_creates_negative_throw_expectations(MatcherManager $matchers, Matcher $matcher, Subject $subject)
 {
     $matchers->find(Argument::cetera())->willReturn($matcher);
     $subject->__call('getWrappedObject', array())->willReturn(new \stdClass());
     $expectation = $this->create('shouldNotThrow', $subject);
     $expectation->shouldHaveType('PhpSpec\\Wrapper\\Subject\\Expectation\\NegativeThrow');
 }
All Usage Examples Of PhpSpec\Runner\MatcherManager::find