Skip to content

Commit e6c36b4

Browse files
committed
Add regression test for issue #16
This was fixed in v1.1.2 of PHP Handlebars Parser.
1 parent 2d1eaf1 commit e6c36b4

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/RegressionTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,6 +2039,16 @@ public static function contextProvider(): array
20392039
'data' => ['flag' => true, 'name' => 'outer'],
20402040
'expected' => '',
20412041
],
2042+
2043+
'#16 - access array items with numeric keys' => [
2044+
'template' => "0: {{this.0.title}}\n1: {{this.1.title}}\n2: {{this.2.title}}",
2045+
'data' => [
2046+
['title' => 'Page A'],
2047+
['title' => 'Page B'],
2048+
['title' => 'Page C'],
2049+
],
2050+
'expected' => "0: Page A\n1: Page B\n2: Page C",
2051+
],
20422052
];
20432053
}
20442054

0 commit comments

Comments
 (0)