aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_framework
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2013-09-09 18:47:25 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2013-09-09 18:47:25 -0500
commit5e09afa0bc3ff9014812282fd4454f0df54b9dfd (patch)
tree11df0dc0628260e2f5dd3381218c602607611477 /tests/test_framework
parent289bc2a411aac4f0adb9b7b649dfd9ef073eaed9 (diff)
downloadforums-5e09afa0bc3ff9014812282fd4454f0df54b9dfd.tar
forums-5e09afa0bc3ff9014812282fd4454f0df54b9dfd.tar.gz
forums-5e09afa0bc3ff9014812282fd4454f0df54b9dfd.tar.bz2
forums-5e09afa0bc3ff9014812282fd4454f0df54b9dfd.tar.xz
forums-5e09afa0bc3ff9014812282fd4454f0df54b9dfd.zip
[ticket/11832] Make $phpbb_container a global initiated by the framework
Setup common items needed from the container (e.g. filesystem) PHPBB3-11832
Diffstat (limited to 'tests/test_framework')
-rw-r--r--tests/test_framework/phpbb_database_test_case.php11
-rw-r--r--tests/test_framework/phpbb_test_case.php11
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php
index c72ea5f765..124706afa6 100644
--- a/tests/test_framework/phpbb_database_test_case.php
+++ b/tests/test_framework/phpbb_database_test_case.php
@@ -17,9 +17,20 @@ 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 8b16f02638..48c2f48887 100644
--- a/tests/test_framework/phpbb_test_case.php
+++ b/tests/test_framework/phpbb_test_case.php
@@ -11,9 +11,20 @@ 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'),