* @license PHP License * @package WB * @subpackage base */ WBClass::load('WBEvent_Handler'); /** * Event_Handler_UnitTest * * UnitTest helper class * * @version 0.1.0 * @package WB * @subpackage base */ class WBEvent_Handler_UnitTest extends WBEvent_Handler { /** * configuration parameter * @var array */ protected $config = array( 'part' => '' ); /** * list processed events * @var array */ protected static $proc = array(); /** * process event * * Simply keep event name in list * * @see isRecoverable() * @param WBEvent $e * @return bool true to continue, false to stop processing * @throws Exception in case of error */ public function process(WBEvent $e) { $part = $this->config['part']; if (empty($part)) { $part = '__default__'; } if (!isset(self::$proc[$part])) { self::$proc[$part] = array(); } self::$proc[$part][] = $e->getName(); return true; } /** * get list of processed events * * * @param string $part * @return array */ public static function getProclist($part = null) { if (empty($part)) { $part = '__default__'; } if (!isset(self::$proc[$part])) { return array(); } return self::$proc[$part]; } /** * flush list * * @param string $part */ public static function flushList($part = null) { if (empty($part)) { $part = '__default__'; } self::$proc[$part] = array(); } } ?>