Explorar o código

Test case for recursive sections with implicit iterators.

Justin Hileman %!s(int64=15) %!d(string=hai) anos
pai
achega
fef6234954
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  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());
+	}
 }