diff --git a/src/FlatArrayTrait.php b/src/FlatArrayTrait.php index 8108405..0dbfbd6 100644 --- a/src/FlatArrayTrait.php +++ b/src/FlatArrayTrait.php @@ -151,7 +151,7 @@ trait FlatArrayTrait { //normalize key names in $value, and also $name $value = $this->normalizeValue($value); - $name = strtolower($name); + $name = $name; //check for home strings if ($name == '' || $name === null) { if ($unset) { @@ -210,7 +210,7 @@ trait FlatArrayTrait } $norm = []; foreach ($value as $key => $value) { - $nKey = preg_replace('/\./', '', strtolower($key)); + $nKey = preg_replace('/\./', '', $key); if ($nKey == '') { throw new \Exception("Key \"$key\" can't be used inside a FlatArray"); } diff --git a/tests/FlatArrayTest.php b/tests/FlatArrayTest.php index 70d10ea..d46565b 100644 --- a/tests/FlatArrayTest.php +++ b/tests/FlatArrayTest.php @@ -89,19 +89,13 @@ class FlatArrayTest extends TestCase ); } - public function testCaseNormalizing() + public function testCaseSensitivity() { $h = new FlatArray([ 'ABC'=>['ABC'=>'ABC'] ]); - $this->assertEquals('ABC', $h['abc.abc']); - $this->assertEquals('ABC', $h['Abc.aBC']); - $h['Abc.aBC'] = 'abc'; - $this->assertEquals('abc', $h['abc.abc']); - $this->assertEquals('abc', $h['Abc.aBC']); - $h['ABC'] = ['ABC'=>'ABC']; - $this->assertEquals('ABC', $h['abc.abc']); - $this->assertEquals('ABC', $h['Abc.aBC']); + $this->assertNull($h['abc.abc']); + $this->assertNull($h['Abc.aBC']); } public function testAccidentalSubstrings()