From 690e28e3df20b0b780d15aabde1430ca69f82217 Mon Sep 17 00:00:00 2001 From: Alexander Deruwe Date: Mon, 10 Sep 2012 10:22:46 +0200 Subject: [PATCH] Convert parameter name to lowercase when removing an element from ParameterBag --- .../Component/DependencyInjection/ParameterBag/ParameterBag.php | 2 +- .../DependencyInjection/Tests/ParameterBag/ParameterBagTest.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php b/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php index 908e2a146fa2..bfcb5eda3bf9 100644 --- a/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php +++ b/src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php @@ -135,7 +135,7 @@ public function has($name) */ public function remove($key) { - unset($this->parameters[$key]); + unset($this->parameters[strtolower($key)]); } /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php b/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php index 46fb35837152..968ae9bcf5f4 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php @@ -54,6 +54,8 @@ public function testRemove() )); $bag->remove('foo'); $this->assertEquals(array('bar' => 'bar'), $bag->all(), '->remove() removes a parameter'); + $bag->remove('BAR'); + $this->assertEquals(array(), $bag->all(), '->remove() converts key to lowercase before removing'); } /**