Exemplo n.º 1
0
 /**
  * A magic call to instantiate an Answer Binder Proxy.
  *
  * @param string $method
  * @param array  $arguments
  *
  * @return Phake_Proxies_AnswerBinderProxy
  */
 public function __call($method, array $arguments)
 {
     $matcher = new Phake_Matchers_MethodMatcher($method, $this->matcherFactory->createMatcherChain($arguments));
     $binder = new Phake_Stubber_AnswerBinder($matcher, Phake::getInfo($this->obj)->getStubMapper());
     return new Phake_Proxies_AnswerBinderProxy($binder);
 }
Exemplo n.º 2
0
 /**
  * A call magic method to provide a more fluent interface to the verifier.
  *
  * @param string $method
  * @param array  $arguments
  *
  * @return Phake_CallRecorder_VerifierResult
  */
 public function __call($method, array $arguments)
 {
     $expectation = new Phake_CallRecorder_CallExpectation($this->verifier->getObject(), $method, $this->matcherFactory->createMatcherChain($arguments), $this->mode);
     $result = $this->verifier->verifyCall($expectation);
     return $this->client->processVerifierResult($result);
 }
Exemplo n.º 3
0
 public function testMatcherChainReturnsNullOnNoArguments()
 {
     $this->assertNull($this->factory->createMatcherChain(array()));
 }
Exemplo n.º 4
0
Arquivo: Phake.php Projeto: kore/Phake
 /**
  * Returns a new stubber specifically for the __call() method
  *
  * @param mixed ... A vararg containing the expected arguments for this call
  *
  * @return \Phake_Proxies_CallStubberProxy
  */
 public static function whenStaticCallMethodWith()
 {
     $arguments = func_get_args();
     $factory = new Phake_Matchers_Factory();
     return new Phake_Proxies_CallStubberProxy($factory->createMatcherChain($arguments), true);
 }