Example #1
0
 public function testGetValue()
 {
     $safe = new SafeDecorator('foo');
     $this->assertEquals('foo', $safe->getValue(), '->getValue() returns the embedded value');
 }
/*
 * 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 __DIR__ . '/../../../bootstrap.php';
use Symfony\Components\OutputEscaper\SafeDecorator;
$t = new LimeTest(13);
// ->getValue()
$t->diag('->getValue()');
$safe = new SafeDecorator('foo');
$t->is($safe->getValue(), 'foo', '->getValue() returns the embedded value');
// ->__set() ->__get()
$t->diag('->__set() ->__get()');
class TestClass1
{
    public $foo = 'bar';
}
$safe = new SafeDecorator(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()