Esempio n. 1
0
 function testStubBase()
 {
     $old_class = SimpleTestOptions::getStubBaseClass();
     SimpleTestOptions::setStubBaseClass('Fred');
     $this->assertEqual(SimpleTestOptions::getStubBaseClass(), 'Fred');
     SimpleTestOptions::setStubBaseClass($old_class);
 }
Esempio n. 2
0
 /**
  *    The new server stub class code in string form.
  *    @param string $class           Class to clone.
  *    @param string $mock_class      New class name.
  *    @param array $methods          Additional methods.
  *    @static
  *    @access private
  */
 function _createClassCode($class, $stub_class, $methods) {
     $stub_base = SimpleTestOptions::getStubBaseClass();
     $code = "class $stub_class extends $stub_base {\n";
     $code .= "    function $stub_class(\$wildcard = MOCK_WILDCARD) {\n";
     $code .= "        \$this->$stub_base(\$wildcard);\n";
     $code .= "    }\n";
     $code .= Stub::_createHandlerCode($class, $stub_base, $methods);
     $code .= "}\n";
     return $code;
 }