$this->assertEquals('foo',$bag->resolveValue('foo'),'->resolveValue() returns its argument unmodified if no placeholders are found');
$bag=newParameterBag(array('foo'=>'bar'));
$this->assertEquals('I\'m a bar',$bag->resolveValue('I\'m a %foo%'),'->resolveValue() replaces placeholders by their values');
$this->assertEquals(array('bar'=>'bar'),$bag->resolveValue(array('%foo%'=>'%foo%')),'->resolveValue() replaces placeholders in keys and values of arrays');
$this->assertEquals(array('bar'=>array('bar'=>array('bar'=>'bar'))),$bag->resolveValue(array('%foo%'=>array('%foo%'=>array('%foo%'=>'%foo%')))),'->resolveValue() replaces placeholders in nested arrays');
$this->assertEquals('I\'m a %foo%',$bag->resolveValue('I\'m a %%foo%%'),'->resolveValue() supports % escaping by doubling it');
$this->assertEquals('I\'m a bar %foo bar',$bag->resolveValue('I\'m a %foo% %%foo %foo%'),'->resolveValue() supports % escaping by doubling it');
$bag=newParameterBag(array('foo'=>true));
$this->assertTrue($bag->resolveValue('%foo%')===true,'->resolveValue() replaces arguments that are just a placeholder by their value without casting them to strings');
$this->assertInstanceOf('\InvalidArgumentException',$e,'->resolveValue() throws an InvalidArgumentException if a placeholder references a non-existent parameter');
$this->assertEquals('The parameter "foobar" must be defined.',$e->getMessage(),'->resolveValue() throws an InvalidArgumentException if a placeholder references a non-existent parameter');
$this->assertInstanceOf('\InvalidArgumentException',$e,'->resolveValue() throws an InvalidArgumentException if a placeholder references a non-existent parameter');
$this->assertEquals('The parameter "foobar" must be defined.',$e->getMessage(),'->resolveValue() throws an InvalidArgumentException if a placeholder references a non-existent parameter');