Просмотр исходного кода

Added test case for resetting pragmas when reusing a single Mustache instance to render multiple templates.

Justin Hileman 16 лет назад
Родитель
Сommit
2fc242a6ae
1 измененных файлов с 6 добавлено и 0 удалено
  1. 6 0
      test/MustachePragmaTest.php

+ 6 - 0
test/MustachePragmaTest.php

@@ -39,4 +39,10 @@ class MustachePragmaTest extends PHPUnit_Framework_TestCase {
 		$this->assertEquals("1\n23", $m->render("1\n2{{%DOT-NOTATION}}\n3"), 'Wrong newline removed with pragma tag');
 	}
 
+	public function testPragmaReset() {
+		$m = new Mustache('', array('symbol' => '>>>'));
+		$this->assertEquals('>>>', $m->render('{{{symbol}}}'));
+		$this->assertEquals('>>>', $m->render('{{%UNESCAPED}}{{symbol}}'));
+		$this->assertEquals('>>>', $m->render('{{{symbol}}}'));
+	}
 }