Skip to content

Commit

Permalink
test(data-get): add coverage for simple * with both array and `Coll…
Browse files Browse the repository at this point in the history
…ection`
  • Loading branch information
jwjenkin committed Jan 2, 2025
1 parent 2da43a3 commit 18580bc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/Support/SupportHelpersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,15 @@ public function testDataGetEscapedSegmentKeys()
$this->assertEquals('caret', data_get($array, 'symbols.{last}.description'));
}

public function testDataGetStar()
{
$data = ['foo' => 'bar'];
$this->assertEquals([ 'bar' ], data_get($data, '*'));

$data = collect(['foo' => 'bar']);
$this->assertEquals([ 'bar' ], data_get($data, '*'));
}

public function testDataGetNullKey()
{
$data = ['foo' => 'bar'];
Expand Down

0 comments on commit 18580bc

Please sign in to comment.