aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_framework
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2012-03-18 22:57:37 +0100
committerDavid King <imkingdavid@gmail.com>2012-03-19 09:12:34 -0400
commit1bbb32a5cffeff4875c4ed0566999cbee8919c86 (patch)
tree47610eac44e19e2439688e98812bf2190738c60d /tests/test_framework
parent76e61951942048e3e98dbe60a3683d5269a4fa0e (diff)
downloadforums-1bbb32a5cffeff4875c4ed0566999cbee8919c86.tar
forums-1bbb32a5cffeff4875c4ed0566999cbee8919c86.tar.gz
forums-1bbb32a5cffeff4875c4ed0566999cbee8919c86.tar.bz2
forums-1bbb32a5cffeff4875c4ed0566999cbee8919c86.tar.xz
forums-1bbb32a5cffeff4875c4ed0566999cbee8919c86.zip
[ticket/10586] Correctly purge board cache and don't rename install directory
PHPBB3-10586
Diffstat (limited to 'tests/test_framework')
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php37
1 files changed, 34 insertions, 3 deletions
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index d569556d02..69c62af297 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -16,6 +16,7 @@ class phpbb_functional_test_case extends phpbb_test_case
protected $cache = null;
protected $db = null;
+ protected $extension_manager = null;
static protected $config = array();
static protected $already_installed = false;
@@ -86,11 +87,41 @@ class phpbb_functional_test_case extends phpbb_test_case
return $this->db;
}
- protected function get_ext_manager()
+ protected function get_cache_driver()
+ {
+ if (!$this->cache)
+ {
+ $this->cache = new phpbb_cache_driver_file;
+ }
+
+ return $this->cache;
+ }
+
+ protected function purge_cache()
+ {
+ $cache = $this->get_cache_driver();
+
+ $cache->purge();
+ $cache->unload();
+ $cache->load();
+ }
+
+ protected function get_extension_manager()
{
global $phpbb_root_path, $phpEx;
- $this->cache = ($this->cache instanceof phpbb_cache_driver_null) ? $this->cache : new phpbb_cache_driver_null;
- return new phpbb_extension_manager($this->get_db(), self::$config['table_prefix'] . 'ext', $phpbb_root_path, ".$phpEx", $this->cache);
+
+ if (!$this->extension_manager)
+ {
+ $this->extension_manager = new phpbb_extension_manager(
+ $this->get_db(),
+ self::$config['table_prefix'] . 'ext',
+ $phpbb_root_path,
+ ".$phpEx",
+ $this->get_cache_driver()
+ );
+ }
+
+ return $this->extension_manager;
}
protected function install_board()