mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
- Deprecate S_ROW_COUNT use S_ROW_NUM
- S_ROW_NUM, S_FIRST_ROW, S_LAST_ROW are now using internal template engine variables saving memory - Other small changes - Update of template tests git-svn-id: file:///svn/phpbb/trunk@9087 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -44,9 +44,25 @@ class phpbb_template_template_test extends PHPUnit_Framework_TestCase
|
||||
|
||||
protected function setUp()
|
||||
{
|
||||
// Test the engine can be used
|
||||
$this->setup_engine();
|
||||
|
||||
if (!is_writable(dirname($this->template->cachepath)))
|
||||
{
|
||||
$this->markTestSkipped("Template cache directory is not writable.");
|
||||
}
|
||||
|
||||
$this->error_reporting = error_reporting(error_reporting() & ~E_NOTICE);
|
||||
}
|
||||
|
||||
protected function tearDown()
|
||||
{
|
||||
error_reporting($this->error_reporting);
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo put test data into templates/xyz.test
|
||||
*/
|
||||
public static function template_data()
|
||||
{
|
||||
return array(
|
||||
@@ -92,19 +108,19 @@ class phpbb_template_template_test extends PHPUnit_Framework_TestCase
|
||||
'loop.html',
|
||||
array(),
|
||||
array('loop' => array(array(), array())),
|
||||
"loop\nloop\nloop",
|
||||
"loop\nloop\nloop\nloop",
|
||||
),
|
||||
array(
|
||||
'loop_vars.html',
|
||||
array(),
|
||||
array('loop' => array(array('VARIABLE' => 'x'))),
|
||||
"first\n0\nx\nlast",
|
||||
"first\n0\n0\nx\nlast",
|
||||
),
|
||||
array(
|
||||
'loop_vars.html',
|
||||
array(),
|
||||
array('loop' => array(array('VARIABLE' => 'x'), array('VARIABLE' => 'y'))),
|
||||
"first\n0\nx\n1\ny\nlast",
|
||||
"first\n0\n0\nx\n1\n1\ny\nlast",
|
||||
),
|
||||
array(
|
||||
'define.html',
|
||||
@@ -138,7 +154,7 @@ class phpbb_template_template_test extends PHPUnit_Framework_TestCase
|
||||
}
|
||||
}
|
||||
|
||||
$this->assertEquals($expected, $this->display('test'), "Testing $file.html");
|
||||
$this->assertEquals($expected, $this->display('test'), "Testing $file");
|
||||
}
|
||||
}
|
||||
?>
|
@@ -9,3 +9,7 @@ loop
|
||||
<!-- ELSE -->
|
||||
noloop
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF .loop == 2 -->
|
||||
loop
|
||||
<!-- ENDIF -->
|
||||
|
@@ -3,6 +3,8 @@
|
||||
|
||||
{loop.S_ROW_COUNT}
|
||||
|
||||
{loop.S_ROW_NUM}
|
||||
|
||||
{loop.VARIABLE}
|
||||
|
||||
<!-- IF loop.S_LAST_ROW -->last<!-- ENDIF -->
|
||||
|
Reference in New Issue
Block a user