Updated implicit iterator test to reflect changes in mustache function names.

This commit is contained in:
Justin Hileman
2010-05-23 00:48:43 -04:00
parent 7d4c68f8ad
commit 1330cf1d48
+4 -3
View File
@@ -6,9 +6,9 @@ require_once 'PHPUnit/Framework.php';
class MustachePragmaImplicitIteratorTest extends PHPUnit_Framework_TestCase { class MustachePragmaImplicitIteratorTest extends PHPUnit_Framework_TestCase {
public function testEnablePragma() { public function testEnablePragma() {
$m = $this->getMock('Mustache', array('renderPragma'), array('{{%IMPLICIT-ITERATOR}}')); $m = $this->getMock('Mustache', array('_renderPragma'), array('{{%IMPLICIT-ITERATOR}}'));
$m->expects($this->exactly(1)) $m->expects($this->exactly(1))
->method('renderPragma') ->method('_renderPragma')
->with(array('{{%IMPLICIT-ITERATOR}}', 'IMPLICIT-ITERATOR', null)); ->with(array('{{%IMPLICIT-ITERATOR}}', 'IMPLICIT-ITERATOR', null));
$m->render(); $m->render();
} }
@@ -31,7 +31,8 @@ class MustachePragmaImplicitIteratorTest extends PHPUnit_Framework_TestCase {
public function testCustomIterator() { public function testCustomIterator() {
$m = new Mustache(null, array('items' => array('foo', 'bar', 'baz'))); $m = new Mustache(null, array('items' => array('foo', 'bar', 'baz')));
$this->assertEquals('foobarbaz', $m->render('{{%IMPLICIT-ITERATOR iterator=item}}{{#items}}{{item}}{{/items}}')); $this->assertEquals('foobarbaz', $m->render('{{%IMPLICIT-ITERATOR}}{{#items}}{{.}}{{/items}}'));
$this->assertEquals('foobarbaz', $m->render('{{%IMPLICIT-ITERATOR iterator=i}}{{#items}}{{i}}{{/items}}'));
$this->assertEquals('foobarbaz', $m->render('{{%IMPLICIT-ITERATOR iterator=items}}{{#items}}{{items}}{{/items}}')); $this->assertEquals('foobarbaz', $m->render('{{%IMPLICIT-ITERATOR iterator=items}}{{#items}}{{items}}{{/items}}'));
} }