aGlobals =& $_aGlobals; } public static function markPending($sMessage = "Not Implemented") { self::markTestIncomplete($sMessage); } public static function getSubclasses() { $aClasses = array(); foreach (get_declared_classes() as $sClassName) { if (is_subclass_of($sClassName, 'CucumberSteps') && (stripos($sClassName,"Mock") === false)) $aClasses[] = $sClassName; } return $aClasses; } /** * @param $sMethod * @return mixed */ function invoke($sMethod) { return $this->$sMethod(); } /** * @static * @param $sClass * @param $oMock * @return void * * Allows tests to set mock hooks to be used */ static function setMock($sClass, $oMock) { self::$aMocks[$sClass] = $oMock; } static function clearMocks() { self::$aMocks = array(); } /** * @static * @param $sClass * @param $aGlobals * @return * * Get an instance of a hook which is either a pre-set mock, * or an instance of the appropriate step class with the globals initialized */ static function getInstance($sClass, $aGlobals) { if (array_key_exists($sClass, self::$aMocks) && self::$aMocks[$sClass]) { return self::$aMocks[$sClass]; } else { return new $sClass($aGlobals); } } } ?>