Browse Source

Test case for recursive sections with implicit iterators.

Justin Hileman 15 years ago
parent
commit
fef6234954
1 changed files with 7 additions and 0 deletions
  1. 7 0
      test/MustachePragmaImplicitIteratorTest.php

+ 7 - 0
test/MustachePragmaImplicitIteratorTest.php

@@ -50,4 +50,11 @@ class MustachePragmaImplicitIteratorTest extends PHPUnit_Framework_TestCase {
 		$this->assertEquals('foobarbaz', $m->render('{{%IMPLICIT-ITERATOR iterator=i}}{{%DOT-NOTATION}}{{#items}}{{i.name}}{{/items}}'));
 	}
 
+	public function testRecursiveSections() {
+		$m = new Mustache(
+			'{{%IMPLICIT-ITERATOR}}{{#items}}{{#.}}{{.}}{{/.}}{{/items}}',
+			array('items' => array(array('a', 'b', 'c'), array('d', 'e', 'f')))
+		);
+		$this->assertEquals('abcdef', $m->render());
+	}
 }