public function ParameterBagTest::testEscapeValue in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/symfony/dependency-injection/Tests/ParameterBag/ParameterBagTest.php \Symfony\Component\DependencyInjection\Tests\ParameterBag\ParameterBagTest::testEscapeValue()
@covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::escapeValue
File
- vendor/
symfony/ dependency-injection/ Tests/ ParameterBag/ ParameterBagTest.php, line 242
Class
Namespace
Symfony\Component\DependencyInjection\Tests\ParameterBagCode
public function testEscapeValue() {
$bag = new ParameterBag();
$bag
->add(array(
'foo' => $bag
->escapeValue(array(
'bar' => array(
'ding' => 'I\'m a bar %foo %bar',
'zero' => null,
),
)),
'bar' => $bag
->escapeValue('I\'m a %foo%'),
));
$this
->assertEquals('I\'m a %%foo%%', $bag
->get('bar'), '->escapeValue() escapes % by doubling it');
$this
->assertEquals(array(
'bar' => array(
'ding' => 'I\'m a bar %%foo %%bar',
'zero' => null,
),
), $bag
->get('foo'), '->escapeValue() escapes % by doubling it');
}