diff options
author | Fyorl <gaelreth@gmail.com> | 2012-11-11 10:44:47 +0000 |
---|---|---|
committer | Fyorl <gaelreth@gmail.com> | 2012-11-11 10:44:47 +0000 |
commit | e3b0e1a8a23b5627388df2b57ef82737c01dd1a1 (patch) | |
tree | bfd8740f2467efb2952ab6ba8138037c6b90a62c /tests/test_framework | |
parent | 3ebabc8da2b04a8ec157345b7c8185b5440cb5ee (diff) | |
download | forums-e3b0e1a8a23b5627388df2b57ef82737c01dd1a1.tar forums-e3b0e1a8a23b5627388df2b57ef82737c01dd1a1.tar.gz forums-e3b0e1a8a23b5627388df2b57ef82737c01dd1a1.tar.bz2 forums-e3b0e1a8a23b5627388df2b57ef82737c01dd1a1.tar.xz forums-e3b0e1a8a23b5627388df2b57ef82737c01dd1a1.zip |
[ticket/11190] Functional tests purge cache before running.
Added functions to get and purge cache to functional framework also.
PHPBB3-11190
Diffstat (limited to 'tests/test_framework')
-rw-r--r-- | tests/test_framework/phpbb_functional_test_case.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index d35913e415..bd248a662e 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -9,11 +9,14 @@ use Symfony\Component\BrowserKit\CookieJar; require_once __DIR__ . '/../../phpBB/includes/functions_install.php'; +require_once __DIR__ . '/../../phpBB/includes/acm/acm_file.php'; +require_once __DIR__ . '/../../phpBB/includes/cache.php'; class phpbb_functional_test_case extends phpbb_test_case { protected $client; protected $root_url; + protected $cache = null; /** * Session ID for current test's session (each test makes its own) @@ -47,6 +50,7 @@ class phpbb_functional_test_case extends phpbb_test_case // that were added in other tests are gone $this->lang = array(); $this->add_lang('common'); + $this->purge_cache(); } public function request($method, $path) @@ -61,6 +65,25 @@ class phpbb_functional_test_case extends phpbb_test_case { } + protected function get_cache_driver() + { + if (!$this->cache) + { + $this->cache = new cache(); + } + + return $this->cache; + } + + protected function purge_cache() + { + $cache = $this->get_cache_driver(); + + $cache->purge(); + $cache->unload(); + $cache->load(); + } + public function __construct($name = NULL, array $data = array(), $dataName = '') { parent::__construct($name, $data, $dataName); |