Skip to content

Commit

Permalink
Add test for lowercaseKeys and uppercaseKeys Arr methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ilbeygi committed Mar 5, 2024
1 parent 348a637 commit ae14cce
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions tests/Support/SupportArrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1309,4 +1309,42 @@ public function testSelect()
],
], Arr::select($array, 'name'));
}

public function testLowercaseKeys()
{
$inputArray = [
'Name' => 'John',
'Age' => 25,
'City' => 'New York',
];

$resultArray = Arr::lowercaseKeys($inputArray);

$expectedArray = [
'name' => 'John',
'age' => 25,
'city' => 'New York',
];

$this->assertSame($expectedArray, $resultArray);
}

public function testUppercaseKeys()
{
$inputArray = [
'Name' => 'John',
'Age' => 25,
'City' => 'New York',
];

$resultArray = Arr::uppercaseKeys($inputArray);

$expectedArray = [
'NAME' => 'John',
'AGE' => 25,
'CITY' => 'New York',
];

$this->assertSame($expectedArray, $resultArray);
}
}

0 comments on commit ae14cce

Please sign in to comment.