public function tearDown() { if (isset($_SERVER['REQUEST_METHOD'])) { unset($_SERVER['REQUEST_METHOD']); } if (!empty($_POST)) { $_POST = array(); } if (!empty($_GET)) { $_GET = array(); } if (!empty($_REQUEST)) { $_REQUEST = array(); } if (midcom_core_context::get()->id != 0) { midcom_core_context::get(0)->set_current(); } if (!$GLOBALS['midcom_config']['auth_allow_sudo']) { $GLOBALS['midcom_config']['auth_allow_sudo'] = true; } while (midcom::get('auth')->is_component_sudo()) { midcom::get('auth')->drop_sudo(); } $queue = array(); while (!empty($this->_testcase_objects)) { $object = array_pop($this->_testcase_objects); if (array_key_exists($object->guid, self::$_class_objects)) { continue; } $queue[] = $object; } self::_process_delete_queue('method', $queue); $this->_testcase_objects = array(); org_openpsa_mail_backend_unittest::flush(); midcom_compat_unittest::flush_registered_headers(); }
public static function flush() { $mails = self::$mails; self::$mails = array(); return $mails; }