mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/13616] Fix UI tests
PHPBB3-13616
This commit is contained in:
parent
bffd963c50
commit
6d2acb5ba3
5 changed files with 17 additions and 4 deletions
|
@ -68,6 +68,8 @@ $phpbb_container = $phpbb_container_builder->get_container();
|
|||
$phpbb_container->get('request')->enable_super_globals();
|
||||
require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
|
||||
|
||||
register_compatibility_globals();
|
||||
|
||||
/* @var $user \phpbb\user */
|
||||
$user = $phpbb_container->get('user');
|
||||
$user->data['user_id'] = ANONYMOUS;
|
||||
|
|
|
@ -134,6 +134,8 @@ $phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
|
|||
|
||||
require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
|
||||
|
||||
register_compatibility_globals();
|
||||
|
||||
// Add own hook handler
|
||||
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
|
||||
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
|
||||
|
|
|
@ -75,5 +75,3 @@ function register_compatibility_globals()
|
|||
/* @var $template \phpbb\template\template */
|
||||
$template = $phpbb_container->get('template');
|
||||
}
|
||||
|
||||
register_compatibility_globals();
|
||||
|
|
|
@ -183,6 +183,9 @@ class container_factory
|
|||
|
||||
// Get compatibilty globals and constants
|
||||
$this->update_helper->include_file('includes/compatibility_globals.' . $this->php_ext);
|
||||
|
||||
register_compatibility_globals();
|
||||
|
||||
$this->update_helper->include_file('includes/constants.' . $this->php_ext);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -256,9 +256,17 @@ class phpbb_ui_test_case extends phpbb_test_case
|
|||
@unlink($phpbb_root_path . 'cache/install_lock');
|
||||
}
|
||||
|
||||
global $phpbb_container, $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log, $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template;
|
||||
global $phpbb_container;
|
||||
$phpbb_container->reset();
|
||||
unset($phpbb_container, $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log, $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template);
|
||||
|
||||
$blacklist = ['phpbb_class_loader_mock', 'phpbb_class_loader_ext', 'phpbb_class_loader'];
|
||||
|
||||
foreach (array_keys($GLOBALS) as $key) {
|
||||
if (is_object($GLOBALS[$key]) && !in_array($key, $blacklist, true))
|
||||
{
|
||||
unset($GLOBALS[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static protected function get_db()
|
||||
|
|
Loading…
Add table
Reference in a new issue