diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2013-06-24 15:28:54 -0500 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2013-06-24 15:28:54 -0500 |
commit | a1f957af84130963ef20855dfee03ba86ab1a9b6 (patch) | |
tree | f954e79dc7c9ec18a6c0a47c627ea009a4f64fb6 /tests | |
parent | ff84aed0b2e5bb2def73a1861e601ad9fb8856df (diff) | |
download | forums-a1f957af84130963ef20855dfee03ba86ab1a9b6.tar forums-a1f957af84130963ef20855dfee03ba86ab1a9b6.tar.gz forums-a1f957af84130963ef20855dfee03ba86ab1a9b6.tar.bz2 forums-a1f957af84130963ef20855dfee03ba86ab1a9b6.tar.xz forums-a1f957af84130963ef20855dfee03ba86ab1a9b6.zip |
[feature/twig] Working on fixing tests
PHPBB3-11598
Diffstat (limited to 'tests')
-rw-r--r-- | tests/template/template_test_case.php | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php index e39896b970..5ff15fff53 100644 --- a/tests/template/template_test_case.php +++ b/tests/template/template_test_case.php @@ -77,32 +77,15 @@ class phpbb_template_template_test_case extends phpbb_test_case // Test the engine can be used $this->setup_engine(); - $template_cache_dir = dirname($this->template->cachepath); - if (!is_writable($template_cache_dir)) - { - $this->markTestSkipped("Template cache directory ({$template_cache_dir}) is not writable."); - } - - foreach (glob($this->template->cachepath . '*') as $file) - { - unlink($file); - } - - $this->setup_engine(); + $this->template->clear_cache(); } protected function tearDown() { - if (is_object($this->template)) - { - foreach (glob($this->template->cachepath . '*') as $file) - { - unlink($file); - } - } + $this->template->clear_cache(); } - protected function run_template($file, array $vars, array $block_vars, array $destroy, $expected, $cache_file) + protected function run_template($file, array $vars, array $block_vars, array $destroy, $expected) { $this->template->set_filenames(array('test' => $file)); $this->template->assign_vars($vars); @@ -123,22 +106,10 @@ class phpbb_template_template_test_case extends phpbb_test_case try { $this->assertEquals($expected, $this->display('test'), "Testing $file"); - $this->assertFileExists($cache_file); } catch (ErrorException $e) { - if (file_exists($cache_file)) - { - copy($cache_file, str_replace('ctpl_', 'tests_ctpl_', $cache_file)); - } throw $e; } - - // For debugging. - // When testing eval path the cache file may not exist. - if (self::PRESERVE_CACHE && file_exists($cache_file)) - { - copy($cache_file, str_replace('ctpl_', 'tests_ctpl_', $cache_file)); - } } } |