From 988865fd0a1d213a441777b3c613265365fe651a Mon Sep 17 00:00:00 2001 From: javiexin Date: Sun, 8 Jan 2017 01:35:18 +0100 Subject: [PATCH] [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 --- tests/template/template_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 3bc2f66ef0..c03da6e646 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -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');