Skip to content

Commit abf0659

Browse files
authored
[9.x]Improve test for pull method in Collection (#43394)
1 parent 3a0ad1a commit abf0659

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/Support/SupportCollectionTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3684,13 +3684,21 @@ public function testPullRetrievesItemFromCollection()
36843684
$c = new Collection(['foo', 'bar']);
36853685

36863686
$this->assertSame('foo', $c->pull(0));
3687+
$this->assertSame('bar', $c->pull(1));
3688+
3689+
$c = new Collection(['foo', 'bar']);
3690+
3691+
$this->assertNull($c->pull(-1));
3692+
$this->assertNull($c->pull(2));
36873693
}
36883694

36893695
public function testPullRemovesItemFromCollection()
36903696
{
36913697
$c = new Collection(['foo', 'bar']);
36923698
$c->pull(0);
36933699
$this->assertEquals([1 => 'bar'], $c->all());
3700+
$c->pull(1);
3701+
$this->assertEquals([], $c->all());
36943702
}
36953703

36963704
public function testPullRemovesItemFromNestedCollection()

0 commit comments

Comments
 (0)