Beispiel #1
0
/*
 * This file is part of the symfony package.
 * (c) Fabien Potencier <*****@*****.**>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
require_once dirname(__FILE__) . '/../../../lib/vendor/lime/lime.php';
require_once dirname(__FILE__) . '/../../../lib/helper/EscapingHelper.php';
require_once dirname(__FILE__) . '/../../../lib/escaper/sfOutputEscaperSafe.class.php';
$t = new lime_test(13);
// ->getValue()
$t->diag('->getValue()');
$safe = new sfOutputEscaperSafe('foo');
$t->is($safe->getValue(), 'foo', '->getValue() returns the embedded value');
// ->__set() ->__get()
$t->diag('->__set() ->__get()');
class TestClass1
{
    public $foo = 'bar';
}
$safe = new sfOutputEscaperSafe(new TestClass1());
$t->is($safe->foo, 'bar', '->__get() returns the object parameter');
$safe->foo = 'baz';
$t->is($safe->foo, 'baz', '->__set() sets the object parameter');
// ->__call()
$t->diag('->__call()');
class TestClass2
{
    public function doSomething()