当前位置: 首页>>代码示例>>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;未经允许,请勿转载。