You are here

public function ParameterBagTest::testResolveUnescapesValue in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php \Symfony\Component\DependencyInjection\Tests\ParameterBag\ParameterBagTest::testResolveUnescapesValue()

@covers Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::resolve

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php, line 226

Class

ParameterBagTest

Namespace

Symfony\Component\DependencyInjection\Tests\ParameterBag

Code

public function testResolveUnescapesValue() {
  $bag = new ParameterBag(array(
    'foo' => array(
      'bar' => array(
        'ding' => 'I\'m a bar %%foo %%bar',
      ),
    ),
    'bar' => 'I\'m a %%foo%%',
  ));
  $bag
    ->resolve();
  $this
    ->assertEquals('I\'m a %foo%', $bag
    ->get('bar'), '->resolveValue() supports % escaping by doubling it');
  $this
    ->assertEquals(array(
    'bar' => array(
      'ding' => 'I\'m a bar %foo %bar',
    ),
  ), $bag
    ->get('foo'), '->resolveValue() supports % escaping by doubling it');
}