1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-20 07:42:09 +02:00

Will he ever be happy? ...

git-svn-id: file:///svn/phpbb/trunk@9094 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Chris Smith 2008-11-23 03:50:16 +00:00
parent ff22d7a368
commit dcf0b15c9f

View File

@ -146,32 +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);
foreach ($block_vars as $block => $loops)
{
foreach ($loops as $_vars)
{
$this->template->assign_block_vars($block, $_vars);
}
}
$this->assertEquals($expected, $this->display('test'), "Testing $file");
$this->assertFileExists($cache_file);
// Reset the engine state
$this->setup_engine();
$this->template->set_filenames(array('test' => $file));
$this->template->assign_vars($vars);
@ -186,5 +162,22 @@ class phpbb_template_template_test extends PHPUnit_Framework_TestCase
$this->assertEquals($expected, $this->display('test'), "Testing $file");
$this->assertFileExists($cache_file);
}
/**
* @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->assertFileNotExists($cache_file);
$this->run_template($file, $vars, $block_vars, $expected, $cache_file);
// Reset the engine state
$this->setup_engine();
$this->run_template($file, $vars, $block_vars, $expected, $cache_file);
}
}
?>