當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Phake::getInfo方法代碼示例

本文整理匯總了PHP中Phake::getInfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP Phake::getInfo方法的具體用法?PHP Phake::getInfo怎麽用?PHP Phake::getInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Phake的用法示例。


在下文中一共展示了Phake::getInfo方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isCalledOn

 /**
  * Creates an answer binder proxy associated with the matchers from the constructor and the object passed here
  *
  * @param Phake_IMock $obj
  *
  * @return Phake_Proxies_AnswerBinderProxy
  */
 public function isCalledOn(Phake_IMock $obj)
 {
     $context = $this->static ? get_class($obj) : $obj;
     $call = $this->static ? '__callStatic' : '__call';
     $matcher = new Phake_Matchers_MethodMatcher($call, $this->argumentMatcher);
     $binder = new Phake_Stubber_AnswerBinder($matcher, Phake::getInfo($context)->getStubMapper());
     return new Phake_Proxies_AnswerBinderProxy($binder);
 }
開發者ID:eric-seekas,項目名稱:Phake,代碼行數:15,代碼來源:CallStubberProxy.php

示例2: __call

 /**
  * 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);
 }
開發者ID:eric-seekas,項目名稱:Phake,代碼行數:14,代碼來源:StubberProxy.php

示例3: isCalledOn

 /**
  * 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);
 }
開發者ID:eric-seekas,項目名稱:Phake,代碼行數:20,代碼來源:CallVerifierProxy.php

示例4: testMockName

 /**
  * Test retrieving mock name
  */
 public function testMockName()
 {
     $newClassName = __CLASS__ . '_TestClass18';
     $mockedClass = 'PhakeTest_MockedClass';
     $this->classGen->generate($newClassName, $mockedClass, $this->infoRegistry);
     $callRecorder = $this->getMock('Phake_CallRecorder_Recorder');
     $stubMapper = $this->getMock('Phake_Stubber_StubMapper');
     $answer = $this->getMock('Phake_Stubber_IAnswer');
     $mock = $this->classGen->instantiate($newClassName, $callRecorder, $stubMapper, $answer);
     $this->assertEquals('PhakeTest_MockedClass', $mock::__PHAKE_name);
     $this->assertEquals('PhakeTest_MockedClass', Phake::getInfo($mock)->getName());
 }
開發者ID:kukupigs,項目名稱:Phake,代碼行數:15,代碼來源:MockClassTest.php

示例5: verifyNoOtherInteractions

 /**
  * Allows for verifying that no other interaction occurred with a mock object outside of what has already been
  * verified
  *
  * @param Phake_IMock $mock
  */
 public static function verifyNoOtherInteractions(Phake_IMock $mock)
 {
     $callRecorder = Phake::getInfo($mock)->getCallRecorder();
     $verifier = new Phake_CallRecorder_Verifier($callRecorder, $mock);
     self::getClient()->processVerifierResult($verifier->verifyNoOtherCalls());
     $sCallRecorder = Phake::getInfo(get_class($mock))->getCallRecorder();
     $sVerifier = new Phake_CallRecorder_Verifier($sCallRecorder, get_class($mock));
     self::getClient()->processVerifierResult($sVerifier->verifyNoOtherCalls());
 }
開發者ID:kore,項目名稱:Phake,代碼行數:15,代碼來源:Phake.php


注:本文中的Phake::getInfo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。