mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/12224] Add assign_block_vars_array() test.
Add tests, also change return value to null. PHPBB3-12224
This commit is contained in:
parent
dda775c418
commit
d29514f3e7
1 changed files with 34 additions and 0 deletions
|
@ -562,6 +562,40 @@ EOT
|
||||||
$this->assertEquals($expect, str_replace(array("\n", "\r", "\t"), '', $this->display('test')), 'Ensuring S_NUM_ROWS is correct after modification');
|
$this->assertEquals($expect, str_replace(array("\n", "\r", "\t"), '', $this->display('test')), 'Ensuring S_NUM_ROWS is correct after modification');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function assign_block_vars_array_data()
|
||||||
|
{
|
||||||
|
return array(
|
||||||
|
array(
|
||||||
|
array(
|
||||||
|
'outer' => array(
|
||||||
|
array('VARIABLE' => 'Test assigning block vars array loop 0:'),
|
||||||
|
array('VARIABLE' => 'Test assigning block vars array loop 1:'),
|
||||||
|
),
|
||||||
|
'outer.middle' => array(
|
||||||
|
array('VARIABLE' => '1st iteration',),
|
||||||
|
array('VARIABLE' => '2nd iteration',),
|
||||||
|
array('VARIABLE' => '3rd iteration',),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @dataProvider assign_block_vars_array_data
|
||||||
|
*/
|
||||||
|
public function test_assign_block_vars_array($block_data)
|
||||||
|
{
|
||||||
|
$this->template->set_filenames(array('test' => 'loop_nested.html'));
|
||||||
|
|
||||||
|
foreach ($block_data as $blockname => $block_vars_array)
|
||||||
|
{
|
||||||
|
$this->template->assign_block_vars_array($blockname, $block_vars_array);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->assertEquals("outer - 0 - Test assigning block vars array loop 0:outer - 1 - Test assigning block vars array loop 1:middle - 0 - 1st iterationmiddle - 1 - 2nd iterationmiddle - 2 - 3rd iteration", $this->display('test'), 'Ensuring assigning block vars array to template is working correctly');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @expectedException Twig_Error_Syntax
|
* @expectedException Twig_Error_Syntax
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue