- try {
- $bag->get('');
- $this->fail('->get() throws an Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException if the key does not exist');
- } catch (\Exception $e) {
- $this->assertInstanceOf('Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException', $e, '->get() throws an Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException if the key does not exist');
- $this->assertEquals('You have requested a non-existent parameter "".', $e->getMessage(), '->get() throws an Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException with some advices');
- }
+ public function provideGetThrowParameterNotFoundExceptionData()
+ {
+ return array(
+ array('foo1', 'You have requested a non-existent parameter "foo1". Did you mean this: "foo"?'),
+ array('bag', 'You have requested a non-existent parameter "bag". Did you mean one of these: "bar", "baz"?'),
+ array('', 'You have requested a non-existent parameter "".'),
+
+ array('fiz.bar.boo', 'You have requested a non-existent parameter "fiz.bar.boo". You cannot access nested array items, do you want to inject "fiz" instead?'),
+ );