PEAR2_Templates_Savant-0.3.2PEAR2_Templates_Savant-0.3.2/test/pear2.php.net/PEAR2_Templates_Savant/globals/escape.nestedarrays.phpt

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--TEST--
\PEAR2\Templates\Savant\Main::addGlobal() Escape added global array
--FILE--
<?php
require dirname(__FILE__) . '/../test_framework.php.inc';
chdir(__DIR__);
$savvy = new \PEAR2\Templates\Savant\Main();

$savvy->setEscape('htmlspecialchars');

$unescaped = array(
    '<a href="Blah">Blah</a>'
);

$savvy->addGlobal('foo', array($unescaped));

$escaped = $savvy->getGlobals();

echo $escaped['foo'][0][0];

?>
--EXPECT--
&lt;a href=&quot;Blah&quot;&gt;Blah&lt;/a&gt;
EOF