コード例 #1
0
 function it_match_by_using_finder_and_analyser(FinderInterface $finder, OccurrencesAnalyserInterface $analyser, UserAgentTokenizedToken $token)
 {
     $iterator = new \SplObjectStorage();
     $occurences = new Occurrences();
     $analyser->analyse(Argument::exact($occurences))->shouldBeCalled()->willReturn($iterator);
     $finder->find($token)->shouldBeCalled()->willReturn($occurences);
     $this->match($token)->shouldReturn($iterator);
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function match(TokenInterface $token)
 {
     return $this->analyser->analyse($this->finder->find($token));
 }