Example #1
0
 function testEscaping()
 {
     $t = new Template('hello.php', array('hello' => '<h1>Some HTML</h1>'));
     $exp = 'Hello, &lt;h1&gt;Some HTML&lt;/h1&gt;! Yeah, <h1>Some HTML</h1>!';
     $this->assertEquals($exp, (string) $t, 'Экранирование включено');
     $t->enableEscaping(false);
     $exp = 'Hello, <h1>Some HTML</h1>! Yeah, <h1>Some HTML</h1>!';
     $this->assertEquals($exp, (string) $t, 'Экранирование выключено');
 }