Explorar el Código

Test case for recursive sections with implicit iterators.

Justin Hileman hace 15 años
padre
commit
fef6234954
Se han modificado 1 ficheros con 7 adiciones y 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());
+	}
 }