From f30b87519e9ead41525e1979cbce874e8a84e2b8 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Mon, 9 Sep 2013 17:28:56 -0500 Subject: [ticket/11832] Inject dependencies for phpbb_get_web_root_path (also moving) Function moved from phpbb_get_web_root_path to filesystem::get_web_root_path PHPBB3-11832 --- tests/test_framework/phpbb_functional_test_case.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/test_framework') diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index ce748bb9cf..dedaf4cd68 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -203,7 +203,7 @@ class phpbb_functional_test_case extends phpbb_test_case $container, $db, $config, - new phpbb_filesystem(), + new phpbb_filesystem($phpbb_root_path), self::$config['table_prefix'] . 'ext', dirname(__FILE__) . '/', $php_ext, -- cgit v1.2.1 From 5e09afa0bc3ff9014812282fd4454f0df54b9dfd Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Mon, 9 Sep 2013 18:47:25 -0500 Subject: [ticket/11832] Make $phpbb_container a global initiated by the framework Setup common items needed from the container (e.g. filesystem) PHPBB3-11832 --- tests/test_framework/phpbb_database_test_case.php | 11 +++++++++++ tests/test_framework/phpbb_test_case.php | 11 +++++++++++ 2 files changed, 22 insertions(+) (limited to 'tests/test_framework') 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'), -- cgit v1.2.1 From d5f93f5ce4c25b4bd0aff9473eb47eeeb1afccd4 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Tue, 10 Sep 2013 10:06:13 -0500 Subject: Revert "[ticket/11832] Make $phpbb_container a global initiated by the framework" This reverts commit 5e09afa0bc3ff9014812282fd4454f0df54b9dfd. --- tests/test_framework/phpbb_database_test_case.php | 11 ----------- tests/test_framework/phpbb_test_case.php | 11 ----------- 2 files changed, 22 deletions(-) (limited to 'tests/test_framework') 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'), -- cgit v1.2.1 From 21624e79fc512fd86177080010bb7d26c71ce3cb Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Fri, 13 Sep 2013 10:04:35 -0500 Subject: [ticket/11832] Fix constructions of phpbb_filesystem PHPBB3-11832 --- tests/test_framework/phpbb_functional_test_case.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/test_framework') diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 579e225ed9..48c5649281 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -203,7 +203,12 @@ class phpbb_functional_test_case extends phpbb_test_case $container, $db, $config, - new phpbb_filesystem($phpbb_root_path), + new phpbb_filesystem( + new phpbb_symfony_request( + new phpbb_mock_request() + ), + $phpbb_root_path + ), self::$config['table_prefix'] . 'ext', dirname(__FILE__) . '/', $php_ext, -- cgit v1.2.1 From b4a374dc73eda55db1c67b87bd65a73f79411ef5 Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Fri, 13 Sep 2013 10:58:03 -0500 Subject: [ticket/11832] Fix INCLUDE(JS/CSS) PHPBB3-11832 --- tests/test_framework/phpbb_functional_test_case.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/test_framework') diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 48c5649281..00f166d4fe 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -207,7 +207,8 @@ class phpbb_functional_test_case extends phpbb_test_case new phpbb_symfony_request( new phpbb_mock_request() ), - $phpbb_root_path + $phpbb_root_path, + $php_ext ), self::$config['table_prefix'] . 'ext', dirname(__FILE__) . '/', -- cgit v1.2.1