Skip to content

Commit c37f4d5

Browse files
[6.x] Fix assertion for forget with single indexed array (#33062)
* Fix assertion for indexed array * Keep the old assertion
1 parent 5b8e68a commit c37f4d5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/Support/SupportCollectionTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,10 +364,13 @@ public function testForgetSingleKey()
364364
$c = new Collection(['foo', 'bar']);
365365
$c = $c->forget(0)->all();
366366
$this->assertFalse(isset($c['foo']));
367+
$this->assertFalse(isset($c[0]));
368+
$this->assertTrue(isset($c[1]));
367369

368370
$c = new Collection(['foo' => 'bar', 'baz' => 'qux']);
369371
$c = $c->forget('foo')->all();
370372
$this->assertFalse(isset($c['foo']));
373+
$this->assertTrue(isset($c['baz']));
371374
}
372375

373376
public function testForgetArrayOfKeys()

0 commit comments

Comments
 (0)