本文整理汇总了PHP中Mock::_addMethodList方法的典型用法代码示例。如果您正苦于以下问题:PHP Mock::_addMethodList方法的具体用法?PHP Mock::_addMethodList怎么用?PHP Mock::_addMethodList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mock
的用法示例。
在下文中一共展示了Mock::_addMethodList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _extendClassCode
/**
* The extension class code as a string. The class
* composites a mock object and chains mocked methods
* to it.
* @param string $class Class to extend.
* @param string $mock_class New class name.
* @param array $methods Mocked methods.
* @return string Code for a new class.
* @static
* @access private
*/
function _extendClassCode($class, $mock_class, $methods)
{
$mock_base = SimpleTestOptions::getMockBaseClass();
$code = "class {$mock_class} extends {$class} {\n";
$code .= " var \$_mock;\n";
$code .= Mock::_addMethodList($methods);
$code .= "\n";
$code .= " function {$mock_class}(&\$test, \$wildcard = MOCK_WILDCARD) {\n";
$code .= " \$this->_mock = &new {$mock_base}(\$test, \$wildcard, false);\n";
$code .= " }\n";
$code .= Mock::_chainMockReturns();
$code .= Mock::_chainMockExpectations();
$code .= Mock::_overrideMethods($methods);
$code .= SimpleTestOptions::getPartialMockCode();
$code .= "}\n";
return $code;
}