本文整理汇总了PHP中Phake::ifUnstubbed方法的典型用法代码示例。如果您正苦于以下问题:PHP Phake::ifUnstubbed方法的具体用法?PHP Phake::ifUnstubbed怎么用?PHP Phake::ifUnstubbed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phake
的用法示例。
在下文中一共展示了Phake::ifUnstubbed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testStubbingChainedMethodsToCallParent
/**
* Tests calling through a chain of calls
*/
public function testStubbingChainedMethodsToCallParent()
{
$mock = Phake::mock('PhakeTest_MockedClass', Phake::ifUnstubbed()->thenCallParent());
$this->assertEquals('test', $mock->callInnerFunc());
}
示例2: testMagicCallChecksFallbackStub
public function testMagicCallChecksFallbackStub()
{
$newClassName = __CLASS__ . '_TestClass22';
$mockedClass = 'PhakeTest_MagicClass';
$this->classGen->generate($newClassName, $mockedClass, $this->infoRegistry);
$callRecorder = Phake::mock('Phake_CallRecorder_Recorder');
$stubMapper = Phake::mock('Phake_Stubber_StubMapper');
$answer = Phake::mock('Phake_Stubber_Answers_NoAnswer', Phake::ifUnstubbed()->thenCallParent());
$mock = $this->classGen->instantiate($newClassName, $callRecorder, $stubMapper, $answer);
$mock->foo('blah');
Phake::verify($stubMapper)->getStubByCall('foo', array('blah'));
Phake::verify($stubMapper)->getStubByCall('__call', array('foo', array('blah')));
}