/**
  * @param string $name
  * @param mixed $arguments
  * @return bool
  */
 private function wasCalledInOrder($name, $arguments)
 {
     $this->current = array_shift($this->scope);
     if (!$this->current) {
         return false;
     }
     $methodCallMatcher = new MethodCallMatcher($name, $arguments);
     return $methodCallMatcher->matches($this->current);
 }
Example #2
0
 /**
  * @test
  */
 public function shouldNotMatchDifferentExactArguments()
 {
     //given
     $matcher = new MethodCallMatcher('fun', array(1, new AnyArgument(), "1"));
     //when
     $result = $matcher->matches(new MethodCall('fun', array(1, "any", "other")));
     //then
     $this->assertFalse($result);
 }