aboutsummaryrefslogtreecommitdiffstats
path: root/tests/template
diff options
context:
space:
mode:
authorjaviexin <javiexin@gmail.com>2017-01-28 21:34:08 +0100
committerjaviexin <javiexin@gmail.com>2017-01-28 21:34:08 +0100
commit849fd9df7d9b2e449801e14ef54584fc8e063d43 (patch)
tree233c7bb52c1222aea81885f83e4e49d633ba13e2 /tests/template
parent20c03cccdde2302412d1e14adda370e7eb57b8e8 (diff)
downloadforums-849fd9df7d9b2e449801e14ef54584fc8e063d43.tar
forums-849fd9df7d9b2e449801e14ef54584fc8e063d43.tar.gz
forums-849fd9df7d9b2e449801e14ef54584fc8e063d43.tar.bz2
forums-849fd9df7d9b2e449801e14ef54584fc8e063d43.tar.xz
forums-849fd9df7d9b2e449801e14ef54584fc8e063d43.zip
[ticket/14944] Add possibility to search for template loop indexes by key
Adds a new function to the template interface, and implements it in the context class. The function returns the ordinal index for a specified key, with the same structure that the key for alter_block_array. Reuses same code. Remove unneeded references, do nothing for int keys. Check out of bounds or wrong blockname errors. Added tests. Remove default parameter value. PHPBB3-14944
Diffstat (limited to 'tests/template')
-rw-r--r--tests/template/template_test.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 33fa4b63a0..997da80246 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -637,8 +637,8 @@ EOT
$this->assertEquals(1, $this->template->find_key_index('outer[2].middle', array('VARIABLE' => '2B')), 'Find index by key in middle loop');
$this->assertEquals(2, $this->template->find_key_index('outer.middle', true), 'Find index at the end of middle loop');
- $this->assertEquals(false, $this->template->find_key_index('outer.wrong'), 'Wrong middle block name');
- $this->assertEquals(false, $this->template->find_key_index('wrong.middle'), 'Wrong outer block name');
+ $this->assertEquals(false, $this->template->find_key_index('outer.wrong', true), 'Wrong middle block name');
+ $this->assertEquals(false, $this->template->find_key_index('wrong.middle', false), 'Wrong outer block name');
}
public function assign_block_vars_array_data()
{