コード例 #1
0
ファイル: CallVerifierProxy.php プロジェクト: ngyuki/phake
 /**
  * Verifies that the call to __call was made on the given object with the parameters passed into the constructor
  *
  * @param Phake_IMock                      $obj
  * @param Phake_CallRecorder_IVerifierMode $verifierMode
  *
  * @return array
  */
 public function isCalledOn(Phake_IMock $obj, Phake_CallRecorder_IVerifierMode $verifierMode = null)
 {
     if ($verifierMode === null) {
         $verifierMode = new Phake_CallRecorder_VerifierMode_Times(1);
     }
     $verifier = new Phake_CallRecorder_Verifier($this->mockReader->getCallRecorder($obj), $obj);
     $expectation = new Phake_CallRecorder_CallExpectation($obj, '__call', $this->arguments, $verifierMode, $this->mockReader);
     $result = $verifier->verifyCall($expectation);
     return $this->client->processVerifierResult($result);
 }
コード例 #2
0
 /**
  * Verifies that the call to __call was made on the given object with the parameters passed into the constructor
  *
  * @param Phake_IMock                      $obj
  * @param Phake_CallRecorder_IVerifierMode $verifierMode
  *
  * @return array
  */
 public function isCalledOn(Phake_IMock $obj, Phake_CallRecorder_IVerifierMode $verifierMode = null)
 {
     if ($verifierMode === null) {
         $verifierMode = new Phake_CallRecorder_VerifierMode_Times(1);
     }
     $context = $this->static ? get_class($obj) : $obj;
     $call = $this->static ? '__callStatic' : '__call';
     $verifier = new Phake_CallRecorder_Verifier(Phake::getInfo($context)->getCallRecorder(), $obj);
     $expectation = new Phake_CallRecorder_CallExpectation($context, $call, $this->argumentMatcher, $verifierMode);
     $result = $verifier->verifyCall($expectation);
     return $this->client->processVerifierResult($result);
 }
コード例 #3
0
ファイル: VerifierProxy.php プロジェクト: eric-seekas/Phake
 /**
  * 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);
 }
コード例 #4
0
ファイル: Freezer.php プロジェクト: ngyuki/phake
 /**
  * Freezes the given $mock and notifies the given $client
  *
  * @param Phake_IMock          $mock
  * @param Phake_Client_IClient $client
  */
 public function freeze(Phake_IMock $mock, Phake_Client_IClient $client)
 {
     $client->processObjectFreeze();
     $this->mockReader->setIsObjectFrozen($mock, true);
 }
コード例 #5
0
ファイル: Freezer.php プロジェクト: eric-seekas/Phake
 /**
  * Freezes the given $mock and notifies the given $client
  *
  * @param Phake_Mock_Info $mockInfo
  * @param Phake_Client_IClient $client
  */
 public function freeze(Phake_Mock_Info $mockInfo, Phake_Client_IClient $client)
 {
     $client->processObjectFreeze();
     $mockInfo->freezeObject();
 }