Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] Add method filterNulls() to Arr #39921

Merged
merged 5 commits into from
Dec 7, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update SupportArrTest.php
  • Loading branch information
chu121su12 authored Dec 7, 2021
commit 9a62d0a077c5a99750af7a3b18a76cb9b3e78888
6 changes: 6 additions & 0 deletions tests/Support/SupportArrTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ public function testExists()
$this->assertFalse(Arr::exists(new Collection(['a' => null]), 'b'));
}

public function testFilterNulls()
{
$array = Arr::filterNulls([null, 0, false, '', null, []]);
$this->assertEquals([0, false, '', []], $array);
}

public function testFirst()
{
$array = [100, 200, 300];
Expand Down