$bag->
resolve();
$this->
assertEquals('I\'m a %foo%',
$bag->
get('bar'
), '->resolveValue() supports % escaping by doubling it'
);
$this->
assertEquals(['bar' =>
['ding' => 'I\'m a bar %foo %bar'
]],
$bag->
get('foo'
), '->resolveValue() supports % escaping by doubling it'
);
} public function testEscapeValue() { $bag =
new ParameterBag();
$bag->
add([ 'foo' =>
$bag->
escapeValue(['bar' =>
['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(['bar' =>
['ding' => 'I\'m a bar %%foo %%bar', 'zero' => null
]],
$bag->
get('foo'
), '->escapeValue() escapes % by doubling it'
);
} /**
* @dataProvider stringsWithSpacesProvider
*/
public function testResolveStringWithSpacesReturnsString($expected,
$test,
$description) {