$this->assertEquals('You have requested a non-existent parameter "baba".',$e->getMessage(),'->get() throws an \InvalidArgumentException if the key does not exist');
$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(array('foo'=>array('bar'=>array('ding'=>'I\'m a bar %foo %bar'))),$bag->resolveValue(array('foo'=>array('bar'=>array('ding'=>'I\'m a bar %%foo %%bar')))),'->resolveValue() supports % escaping by doubling it');
$this->assertSame(true,$bag->resolveValue('%foo%'),'->resolveValue() replaces arguments that are just a placeholder by their value without casting them to strings');
$bag=newParameterBag(array('foo'=>null));
$this->assertSame(null,$bag->resolveValue('%foo%'),'->resolveValue() replaces arguments that are just a placeholder by their value without casting them to strings');
$this->assertEquals('You have requested a non-existent parameter "foobar".',$e->getMessage(),'->resolveValue() throws a ParameterNotFoundException if a placeholder references a non-existent parameter');
$this->fail('->resolveValue() throws a ParameterNotFoundException if a placeholder references a non-existent parameter');
}catch(ParameterNotFoundException$e){
$this->assertEquals('You have requested a non-existent parameter "foobar".',$e->getMessage(),'->resolveValue() throws a ParameterNotFoundException if a placeholder references a non-existent parameter');
$this->assertEquals('A string value must be composed of strings and/or numbers, but found parameter "bar" of type array inside string value "a %bar%".',$e->getMessage(),'->resolveValue() throws a RuntimeException when a parameter embeds another non-string parameter');
$this->fail('->resolveValue() throws a ParameterCircularReferenceException when a parameter has a circular reference');
}catch(ParameterCircularReferenceException$e){
$this->assertEquals('Circular reference detected for parameter "foo" ("foo" > "bar" > "foobar" > "foo").',$e->getMessage(),'->resolveValue() throws a ParameterCircularReferenceException when a parameter has a circular reference');
$this->fail('->resolveValue() throws a ParameterCircularReferenceException when a parameter has a circular reference');
}catch(ParameterCircularReferenceException$e){
$this->assertEquals('Circular reference detected for parameter "foo" ("foo" > "bar" > "foobar" > "foo").',$e->getMessage(),'->resolveValue() throws a ParameterCircularReferenceException when a parameter has a circular reference');