aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2013-09-10 10:06:13 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2013-09-10 10:06:13 -0500
commitd5f93f5ce4c25b4bd0aff9473eb47eeeb1afccd4 (patch)
treedcaa94a5400b6fbdecc91896cf08e545f627b45e
parent5e09afa0bc3ff9014812282fd4454f0df54b9dfd (diff)
downloadforums-d5f93f5ce4c25b4bd0aff9473eb47eeeb1afccd4.tar
forums-d5f93f5ce4c25b4bd0aff9473eb47eeeb1afccd4.tar.gz
forums-d5f93f5ce4c25b4bd0aff9473eb47eeeb1afccd4.tar.bz2
forums-d5f93f5ce4c25b4bd0aff9473eb47eeeb1afccd4.tar.xz
forums-d5f93f5ce4c25b4bd0aff9473eb47eeeb1afccd4.zip
Revert "[ticket/11832] Make $phpbb_container a global initiated by the framework"
-rw-r--r--tests/acp_board/select_auth_method_test.php5
-rw-r--r--tests/content_visibility/delete_post_test.php7
-rw-r--r--tests/log/function_view_log_test.php4
-rw-r--r--tests/test_framework/phpbb_database_test_case.php11
-rw-r--r--tests/test_framework/phpbb_test_case.php11
5 files changed, 11 insertions, 27 deletions
diff --git a/tests/acp_board/select_auth_method_test.php b/tests/acp_board/select_auth_method_test.php
index aaad05b33a..91aa5d1232 100644
--- a/tests/acp_board/select_auth_method_test.php
+++ b/tests/acp_board/select_auth_method_test.php
@@ -27,7 +27,10 @@ class phpbb_acp_board_select_auth_method_test extends phpbb_test_case
{
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_invalid' => new phpbb_auth_provider_acp_board_invalid,
));
diff --git a/tests/content_visibility/delete_post_test.php b/tests/content_visibility/delete_post_test.php
index f5df5e9cba..6234aac9ad 100644
--- a/tests/content_visibility/delete_post_test.php
+++ b/tests/content_visibility/delete_post_test.php
@@ -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)
{
- 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';
$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');
- $this->phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
- $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 = new phpbb_mock_container_builder();
+ $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);
diff --git a/tests/log/function_view_log_test.php b/tests/log/function_view_log_test.php
index 6827aaa1b6..a634863fb6 100644
--- a/tests/log/function_view_log_test.php
+++ b/tests/log/function_view_log_test.php
@@ -23,8 +23,10 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
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_container = new phpbb_mock_container_builder();
+ $phpbb_container->set('filesystem', new phpbb_filesystem($phpbb_root_path));
$expected_data_sets = array(
1 => array(
diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php
index 124706afa6..c72ea5f765 100644
--- a/tests/test_framework/phpbb_database_test_case.php
+++ b/tests/test_framework/phpbb_database_test_case.php
@@ -17,20 +17,9 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
protected $fixture_xml_data;
- protected $phpbb_container;
-
public function __construct($name = NULL, array $data = array(), $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(
'PHP_CodeCoverage' => array('instance'),
'PHP_CodeCoverage_Filter' => array('instance'),
diff --git a/tests/test_framework/phpbb_test_case.php b/tests/test_framework/phpbb_test_case.php
index 48c2f48887..8b16f02638 100644
--- a/tests/test_framework/phpbb_test_case.php
+++ b/tests/test_framework/phpbb_test_case.php
@@ -11,20 +11,9 @@ class phpbb_test_case extends PHPUnit_Framework_TestCase
{
protected $test_case_helpers;
- protected $phpbb_container;
-
public function __construct($name = NULL, array $data = array(), $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(
'PHP_CodeCoverage' => array('instance'),
'PHP_CodeCoverage_Filter' => array('instance'),