[ticket/14950] Add possibility to delete a template block

Adds a new mode to alter_block_array to allow for the deletion of
a certain block of template variables.  The selection method is the
same as for the other modes for alter_block_array.  The passed in
vararray is ignored, and an out of bounds index is considered an error.
Added tests for the new function, fixed.

PHPBB3-14950
This commit is contained in:
javiexin 2017-01-08 01:35:18 +01:00
parent 7f8dd6b007
commit 988865fd0a

View file

@ -636,7 +636,7 @@ EOT
$this->template->alter_block_array('outer', array(), 1, 'delete');
$expect = 'outer - 0 - one[outer|2]outer - 1 - three[outer|3]middle - 0 - 3A[middle|3]middle - 1 - 3B[middle|3]middle - 2 - 3C[middle|3]';
$expect = 'outer - 0 - one[outer|2]outer - 1 - three[outer|2]middle - 0 - 3A[middle|3]middle - 1 - 3B[middle|3]middle - 2 - 3C[middle|3]';
$this->assertEquals($expect, str_replace(array("\n", "\r", "\t"), '', $this->display('test')), 'Deleting by index at top level');
$this->template->alter_block_array('outer.middle', array(), 1, 'delete');