function testTestCaseRegistry() { $test =& new MockSimpleTestCase($this); $class = SimpleMock::registerTest($test); $this->assertReference($test, SimpleMock::injectTest($class)); }
/** * Creates an empty return list and expectation list. * All call counts are set to zero. * @param SimpleTestCase $test Test case to test expectations in. * @param mixed $wildcard Parameter matching wildcard. * @param boolean $is_strict Enables method name checks on * expectations. * @access public */ function SimpleMock(&$test, $wildcard, $is_strict = true) { $this->SimpleStub($wildcard, $is_strict); if (!$test) { trigger_error('No unit tester for mock object', E_USER_ERROR); return; } $this->_test = SimpleMock::registerTest($test); $this->_expected_counts = array(); $this->_max_counts = array(); $this->_expected_args = array(); $this->_expected_args_at = array(); }