aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorDavid King <imkingdavid@gmail.com>2012-03-16 16:42:29 -0400
committerDavid King <imkingdavid@gmail.com>2012-03-19 09:12:33 -0400
commit66b45318efea886ac6afc1f332cc94ee2af1c494 (patch)
treecaeae16b9df46e69cb90d908efc4684da0f49776 /tests
parent7b44d6f21a5a8be289bf6810f2c38d580647581e (diff)
downloadforums-66b45318efea886ac6afc1f332cc94ee2af1c494.tar
forums-66b45318efea886ac6afc1f332cc94ee2af1c494.tar.gz
forums-66b45318efea886ac6afc1f332cc94ee2af1c494.tar.bz2
forums-66b45318efea886ac6afc1f332cc94ee2af1c494.tar.xz
forums-66b45318efea886ac6afc1f332cc94ee2af1c494.zip
[ticket/10586] browse tests now work, but mine dont. at least we are making progress
PHPBB3-10586
Diffstat (limited to 'tests')
-rw-r--r--tests/functional/browse_test.php11
-rw-r--r--tests/functional/extension_controller_test.php22
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php12
3 files changed, 44 insertions, 1 deletions
diff --git a/tests/functional/browse_test.php b/tests/functional/browse_test.php
index 723cf93232..d119787d13 100644
--- a/tests/functional/browse_test.php
+++ b/tests/functional/browse_test.php
@@ -12,6 +12,17 @@
*/
class phpbb_functional_browse_test extends phpbb_functional_test_case
{
+ public static function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+ $f_path = self::$config['phpbb_functional_path'];
+ // we cannot run these tests correctly if the install directory is present
+ if (is_dir($f_path . 'install/'))
+ {
+ rename($f_path . 'install/', $f_path . 'install_/');
+ }
+ // NOTE: this will need to be renamed back again later if you wish to test again
+ }
public function test_index()
{
$crawler = $this->request('GET', 'index.php');
diff --git a/tests/functional/extension_controller_test.php b/tests/functional/extension_controller_test.php
index b52174bbd5..50710d0347 100644
--- a/tests/functional/extension_controller_test.php
+++ b/tests/functional/extension_controller_test.php
@@ -19,7 +19,27 @@ class phpbb_functional_extension_controller_test extends phpbb_functional_test_c
static public function setUpBeforeClass()
{
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/',
+ );
// When you add new tests that require new fixtures, add them to the array.
+ foreach ($directories as $dir)
+ {
+ if (!is_dir($dir))
+ {
+ mkdir($dir, 0777, true);
+ }
+ }
+
$fixtures = array(
'error/class/controller.php',
'error/class/ext.php',
@@ -38,7 +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", self::$config['phpbb_functional_url'] . "/ext/$fixture"))
+ if(!copy("tests/functional/fixtures/ext/$fixture", "{$f_path}ext/$fixture"))
{
echo 'Could not copy file ' . $fixture;
}
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index 9c91778cb0..51b04db263 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -80,6 +80,11 @@ class phpbb_test_case_helpers
{
$config['phpbb_functional_url'] = $phpbb_functional_url;
}
+
+ if (isset($phpbb_functional_path))
+ {
+ $config['phpbb_functional_path'] = $phpbb_functional_path;
+ }
}
if (isset($_SERVER['PHPBB_TEST_DBMS']))
@@ -101,6 +106,13 @@ class phpbb_test_case_helpers
));
}
+ if (isset($_SERVER['PHPBB_FUNCTIONAL_PATH']))
+ {
+ $config = array_merge($config, array(
+ 'phpbb_functional_path' => isset($_SERVER['PHPBB_FUNCTIONAL_PATH']) ? $_SERVER['PHPBB_FUNCTIONAL_PATH'] : '',
+ ));
+ }
+
return $config;
}
}