mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-09 21:08:53 +00:00
Revert "[ticket/11832] Make $phpbb_container a global initiated by the framework"
This reverts commit 5e09afa0bc
.
This commit is contained in:
parent
5e09afa0bc
commit
d5f93f5ce4
5 changed files with 11 additions and 27 deletions
|
@ -27,7 +27,10 @@ class phpbb_acp_board_select_auth_method_test extends phpbb_test_case
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$this->phpbb_container->set('auth.provider_collection', array(
|
global $phpbb_container;
|
||||||
|
$phpbb_container = new phpbb_mock_container_builder();
|
||||||
|
|
||||||
|
$phpbb_container->set('auth.provider_collection', array(
|
||||||
'auth.provider.acp_board_valid' => new phpbb_auth_provider_acp_board_valid,
|
'auth.provider.acp_board_valid' => new phpbb_auth_provider_acp_board_valid,
|
||||||
'auth.provider.acp_board_invalid' => new phpbb_auth_provider_acp_board_invalid,
|
'auth.provider.acp_board_invalid' => new phpbb_auth_provider_acp_board_invalid,
|
||||||
));
|
));
|
||||||
|
|
|
@ -262,7 +262,7 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
|
||||||
*/
|
*/
|
||||||
public function test_delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $reason, $expected_posts, $expected_topic, $expected_forum)
|
public function test_delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $reason, $expected_posts, $expected_topic, $expected_forum)
|
||||||
{
|
{
|
||||||
global $auth, $cache, $config, $db, $phpbb_root_path, $phpEx;
|
global $auth, $cache, $config, $db, $phpbb_container, $phpbb_root_path, $phpEx;
|
||||||
|
|
||||||
$config['search_type'] = 'phpbb_mock_search';
|
$config['search_type'] = 'phpbb_mock_search';
|
||||||
$cache = new phpbb_mock_cache;
|
$cache = new phpbb_mock_cache;
|
||||||
|
@ -279,8 +279,9 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
|
||||||
)));
|
)));
|
||||||
$user = $this->getMock('phpbb_user');
|
$user = $this->getMock('phpbb_user');
|
||||||
|
|
||||||
$this->phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
|
$phpbb_container = new phpbb_mock_container_builder();
|
||||||
$this->phpbb_container->set('content.visibility', new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
|
$phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
|
||||||
|
$phpbb_container->set('content.visibility', new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
|
||||||
|
|
||||||
delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $reason);
|
delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $reason);
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,10 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
|
||||||
|
|
||||||
public static function view_log_function_data()
|
public static function view_log_function_data()
|
||||||
{
|
{
|
||||||
global $phpEx, $phpbb_dispatcher;
|
global $phpEx, $phpbb_dispatcher, $phpbb_container, $phpbb_root_path;
|
||||||
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
|
||||||
|
$phpbb_container = new phpbb_mock_container_builder();
|
||||||
|
$phpbb_container->set('filesystem', new phpbb_filesystem($phpbb_root_path));
|
||||||
|
|
||||||
$expected_data_sets = array(
|
$expected_data_sets = array(
|
||||||
1 => array(
|
1 => array(
|
||||||
|
|
|
@ -17,20 +17,9 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
|
||||||
|
|
||||||
protected $fixture_xml_data;
|
protected $fixture_xml_data;
|
||||||
|
|
||||||
protected $phpbb_container;
|
|
||||||
|
|
||||||
public function __construct($name = NULL, array $data = array(), $dataName = '')
|
public function __construct($name = NULL, array $data = array(), $dataName = '')
|
||||||
{
|
{
|
||||||
parent::__construct($name, $data, $dataName);
|
parent::__construct($name, $data, $dataName);
|
||||||
|
|
||||||
global $phpbb_container, $phpbb_root_path;
|
|
||||||
|
|
||||||
// Setup the container for global usage
|
|
||||||
$this->phpbb_container = $phpbb_container = new phpbb_mock_container_builder();
|
|
||||||
|
|
||||||
// Set some commonly needed systems up
|
|
||||||
$phpbb_container->set('filesystem', new phpbb_filesystem($phpbb_root_path));
|
|
||||||
|
|
||||||
$this->backupStaticAttributesBlacklist += array(
|
$this->backupStaticAttributesBlacklist += array(
|
||||||
'PHP_CodeCoverage' => array('instance'),
|
'PHP_CodeCoverage' => array('instance'),
|
||||||
'PHP_CodeCoverage_Filter' => array('instance'),
|
'PHP_CodeCoverage_Filter' => array('instance'),
|
||||||
|
|
|
@ -11,20 +11,9 @@ class phpbb_test_case extends PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
protected $test_case_helpers;
|
protected $test_case_helpers;
|
||||||
|
|
||||||
protected $phpbb_container;
|
|
||||||
|
|
||||||
public function __construct($name = NULL, array $data = array(), $dataName = '')
|
public function __construct($name = NULL, array $data = array(), $dataName = '')
|
||||||
{
|
{
|
||||||
parent::__construct($name, $data, $dataName);
|
parent::__construct($name, $data, $dataName);
|
||||||
|
|
||||||
global $phpbb_container, $phpbb_root_path;
|
|
||||||
|
|
||||||
// Setup the container for global usage
|
|
||||||
$this->phpbb_container = $phpbb_container = new phpbb_mock_container_builder();
|
|
||||||
|
|
||||||
// Set some commonly needed systems up
|
|
||||||
$phpbb_container->set('filesystem', new phpbb_filesystem($phpbb_root_path));
|
|
||||||
|
|
||||||
$this->backupStaticAttributesBlacklist += array(
|
$this->backupStaticAttributesBlacklist += array(
|
||||||
'PHP_CodeCoverage' => array('instance'),
|
'PHP_CodeCoverage' => array('instance'),
|
||||||
'PHP_CodeCoverage_Filter' => array('instance'),
|
'PHP_CodeCoverage_Filter' => array('instance'),
|
||||||
|
|
Loading…
Add table
Reference in a new issue