From 18580bc3f1f782949187e1df87d99ec40f8463ad Mon Sep 17 00:00:00 2001 From: jwjenkin Date: Thu, 2 Jan 2025 09:42:54 -0500 Subject: [PATCH] test(data-get): add coverage for simple `*` with both array and `Collection` --- tests/Support/SupportHelpersTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/Support/SupportHelpersTest.php b/tests/Support/SupportHelpersTest.php index 38ed83afdf96..ec0a5d5bbc78 100644 --- a/tests/Support/SupportHelpersTest.php +++ b/tests/Support/SupportHelpersTest.php @@ -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'];