From 6a0bad8c0b7bdb261c0ee72b850bc727de6d019b Mon Sep 17 00:00:00 2001 From: David King Date: Mon, 19 Mar 2012 09:56:48 -0400 Subject: [PATCH] [ticket/10586] Tests finally work (thanks naderman) PHPBB3-10586 --- .../functional/extension_controller_test.php | 25 +++++++++---------- .../phpbb_test_case_helpers.php | 10 -------- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php index dd8aa1181b..263d48c034 100644 --- a/tests/functional/extension_controller_test.php +++ b/tests/functional/extension_controller_test.php @@ -19,20 +19,20 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c */ static public function setUpBeforeClass() { + global $phpbb_root_path; parent::setUpBeforeClass(); - $f_path = self::$config['phpbb_functional_path']; // these directories need to be created before the files can be copied $directories = array( - $f_path . 'ext/error/class/', - $f_path . 'ext/error/classtype/', - $f_path . 'ext/error/disabled/', - $f_path . 'ext/foo/bar/', - $f_path . 'ext/foo/bar/styles/prosilver/template/', - $f_path . 'ext/foobar/', - $f_path . 'ext/foobar/styles/prosilver/template/', + $phpbb_root_path . 'ext/error/class/', + $phpbb_root_path . 'ext/error/classtype/', + $phpbb_root_path . 'ext/error/disabled/', + $phpbb_root_path . 'ext/foo/bar/', + $phpbb_root_path . 'ext/foo/bar/styles/prosilver/template/', + $phpbb_root_path . 'ext/foobar/', + $phpbb_root_path . 'ext/foobar/styles/prosilver/template/', ); - // When you add new tests that require new fixtures, add them to the array. + foreach ($directories as $dir) { if (!is_dir($dir)) @@ -58,8 +58,7 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c foreach ($fixtures as $fixture) { - // we have to use self::$config['phpbb_functional_url'] because $this->root_url is not available in static classes - if(!copy("tests/functional/fixtures/ext/$fixture", "{$f_path}ext/$fixture")) + if(!copy("tests/functional/fixtures/ext/$fixture", "{$phpbb_root_path}ext/$fixture")) { echo 'Could not copy file ' . $fixture; } @@ -68,9 +67,9 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c public static function tearDownAfterClass() { - $f_path = self::$config['phpbb_functional_path']; + $phpbb_root_path = self::$config['phpbb_functional_path']; - // @todo delete the fixtures from the $f_path board + // @todo delete the fixtures from the $phpbb_root_path board // Note that it might be best to find a public domain function // and port it into here instead of writing it from scratch } diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php index 4aec07a8fb..9c91778cb0 100644 --- a/tests/test_framework/phpbb_test_case_helpers.php +++ b/tests/test_framework/phpbb_test_case_helpers.php @@ -80,11 +80,6 @@ class phpbb_test_case_helpers { $config['phpbb_functional_url'] = $phpbb_functional_url; } - - if (!empty($phpbb_functional_path)) - { - $config['phpbb_functional_path'] = $phpbb_functional_path; - } } if (isset($_SERVER['PHPBB_TEST_DBMS'])) @@ -106,11 +101,6 @@ class phpbb_test_case_helpers )); } - if (!empty($_SERVER['PHPBB_FUNCTIONAL_PATH'])) - { - $config['phpbb_functional_path'] = $_SERVER['PHPBB_FUNCTIONAL_PATH']; - } - return $config; } }