public function ParameterBagTest::testEscapeValue in Service Container 7.2
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php \Symfony\Component\DependencyInjection\Tests\ParameterBag\ParameterBagTest::testEscapeValue()
@covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::escapeValue
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ 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');
}