PEAR2_Templates_Savant-0.2.0PEAR2_Templates_Savant-0.2.0/test/PEAR2_Templates_Savant/pear2.php.net/escape/object.phpt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
\PEAR2\Templates\Savant\Main::addEscaoe() object variable escaping test
--FILE--
<?php
require dirname(__FILE__) . '/../test_framework.php.inc';
chdir(__DIR__);
$savant = new \PEAR2\Templates\Savant\Main();
$savant->setEscape('htmlspecialchars');

class Foo
{
    public $var1;
}

$object = new Foo();
$object->var1  = '<p></p>';

$test->assertEquals(htmlspecialchars($object->var1), $savant->render($object), 'render object with variable escaping');

$test->assertEquals($object->var1, $savant->render($object, 'raw.tpl.php'), 'render object with raw variable access');
?>
===DONE===
--EXPECT--
===DONE===
EOF