コード例 #1
0
 function testTestCaseRegistry()
 {
     $test =& new MockSimpleTestCase($this);
     $class = SimpleMock::registerTest($test);
     $this->assertReference($test, SimpleMock::injectTest($class));
 }
コード例 #2
0
ファイル: mock_functions.php プロジェクト: pyfun/dokuwiki
 /**
  *    Sets up the mock, creating a generator depending on whether
  *    the function is already declared
  *    @param string $function    Name of function being mocked
  */
 function SimpleMockFunction($function)
 {
     SimpleMock::SimpleMock();
     if (function_exists($function)) {
         $this->_generator = new SimpleDeclaredFunctionGenerator($function);
     } else {
         $this->_generator = new SimpleUndeclaredFunctionGenerator($function);
     }
 }
コード例 #3
0
 function __construct()
 {
     parent::__construct();
 }
コード例 #4
0
 /**
  *    Resolves the dependency on the test case.
  *    @param string $class      Key to look up test case in.
  *    @return SimpleTestCase    Test case to send results to.
  *    @access public
  *    @static
  */
 function &injectTest($key)
 {
     $registry =& SimpleMock::_getRegistry();
     return $registry[$key];
 }