This repository has been archived by the owner on Mar 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #318 from tighten/v8.83.18-changes
V8.83.18 changes
- Loading branch information
Showing
4 changed files
with
22 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -620,19 +620,25 @@ public function testPull() | |
$array = ['name' => 'Desk', 'price' => 100]; | ||
$name = Arr::pull($array, 'name'); | ||
$this->assertSame('Desk', $name); | ||
$this->assertEquals(['price' => 100], $array); | ||
$this->assertSame(['price' => 100], $array); | ||
|
||
// Only works on first level keys | ||
$array = ['[email protected]' => 'Joe', 'jane@localhost' => 'Jane']; | ||
$name = Arr::pull($array, '[email protected]'); | ||
$this->assertSame('Joe', $name); | ||
$this->assertEquals(['jane@localhost' => 'Jane'], $array); | ||
$this->assertSame(['jane@localhost' => 'Jane'], $array); | ||
|
||
// Does not work for nested keys | ||
$array = ['emails' => ['[email protected]' => 'Joe', 'jane@localhost' => 'Jane']]; | ||
$name = Arr::pull($array, '[email protected]'); | ||
$this->assertNull($name); | ||
$this->assertEquals(['emails' => ['[email protected]' => 'Joe', 'jane@localhost' => 'Jane']], $array); | ||
$this->assertSame(['emails' => ['[email protected]' => 'Joe', 'jane@localhost' => 'Jane']], $array); | ||
|
||
// Works with int keys | ||
$array = ['First', 'Second']; | ||
$first = Arr::pull($array, 0); | ||
$this->assertSame('First', $first); | ||
$this->assertSame([1 => 'Second'], $array); | ||
} | ||
|
||
public function testQuery() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters