Skip to content

Commit 6608e14

Browse files
committed
Test is_first_key_operator() with empty and packed arrays
1 parent e7882bc commit 6608e14

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/FunctionsTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ public function testIsFirstKeyOperator(callable $cast): void
155155
{
156156
$this->assertFalse(is_first_key_operator($cast(['y' => 1])));
157157
$this->assertTrue(is_first_key_operator($cast(['$set' => ['y' => 1]])));
158+
159+
// Empty and packed arrays are unlikely arguments, but still valid
160+
$this->assertFalse(is_first_key_operator($cast([])));
161+
$this->assertFalse(is_first_key_operator($cast(['foo'])));
158162
}
159163

160164
/** @dataProvider provideInvalidDocumentValues */

0 commit comments

Comments
 (0)