aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Smith <toonarmy@phpbb.com>2008-11-23 03:50:16 +0000
committerChris Smith <toonarmy@phpbb.com>2008-11-23 03:50:16 +0000
commitdcf0b15c9fc90dc324e315ee056d3cbf67ed1928 (patch)
tree8069dca1254f6274795b9b0e3da6203f64d349cb
parentff22d7a3687791fb4659f4808b4425a78d8bfc71 (diff)
downloadforums-dcf0b15c9fc90dc324e315ee056d3cbf67ed1928.tar
forums-dcf0b15c9fc90dc324e315ee056d3cbf67ed1928.tar.gz
forums-dcf0b15c9fc90dc324e315ee056d3cbf67ed1928.tar.bz2
forums-dcf0b15c9fc90dc324e315ee056d3cbf67ed1928.tar.xz
forums-dcf0b15c9fc90dc324e315ee056d3cbf67ed1928.zip
Will he ever be happy? ...
git-svn-id: file:///svn/phpbb/trunk@9094 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--tests/template/template.php35
1 files changed, 14 insertions, 21 deletions
diff --git a/tests/template/template.php b/tests/template/template.php
index 3e0143f599..f1ab22dc2b 100644
--- a/tests/template/template.php
+++ b/tests/template/template.php
@@ -146,15 +146,8 @@ class phpbb_template_template_test extends PHPUnit_Framework_TestCase
);
}
- /**
- * @dataProvider template_data
- */
- public function test_template($file, array $vars, array $block_vars, $expected)
+ private function run_template($file, array $vars, array $block_vars, $expected, $cache_file)
{
- $cache_file = $this->template->cachepath . str_replace('/', '.', $file) . '.' . PHP_EXT;
-
- $this->assertFileNotExists($cache_file);
-
$this->template->set_filenames(array('test' => $file));
$this->template->assign_vars($vars);
@@ -168,23 +161,23 @@ class phpbb_template_template_test extends PHPUnit_Framework_TestCase
$this->assertEquals($expected, $this->display('test'), "Testing $file");
$this->assertFileExists($cache_file);
+ }
- // Reset the engine state
- $this->setup_engine();
+ /**
+ * @dataProvider template_data
+ */
+ public function test_template($file, array $vars, array $block_vars, $expected)
+ {
+ $cache_file = $this->template->cachepath . str_replace('/', '.', $file) . '.' . PHP_EXT;
- $this->template->set_filenames(array('test' => $file));
- $this->template->assign_vars($vars);
+ $this->assertFileNotExists($cache_file);
- foreach ($block_vars as $block => $loops)
- {
- foreach ($loops as $_vars)
- {
- $this->template->assign_block_vars($block, $_vars);
- }
- }
+ $this->run_template($file, $vars, $block_vars, $expected, $cache_file);
- $this->assertEquals($expected, $this->display('test'), "Testing $file");
- $this->assertFileExists($cache_file);
+ // Reset the engine state
+ $this->setup_engine();
+
+ $this->run_template($file, $vars, $block_vars, $expected, $cache_file);
}
}
?> \ No newline at end of file