You are here

public function ParameterBagTest::testEscapeValue in Zircon Profile 8.0

Same name and namespace in other branches
  1. 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

ParameterBagTest

Namespace

Symfony\Component\DependencyInjection\Tests\ParameterBag

Code

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');
}