Skip to content

Commit e4f6c3f

Browse files
authored
[9.x] Improve test for nth Method in Collection (#43386)
1 parent f3c4f5a commit e4f6c3f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/Support/SupportCollectionTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3099,6 +3099,11 @@ public function testNth($collection)
30993099
$this->assertEquals(['d'], $data->nth(4, 3)->all());
31003100
$this->assertEquals(['c', 'e'], $data->nth(2, 2)->all());
31013101
$this->assertEquals(['c', 'd', 'e', 'f'], $data->nth(1, 2)->all());
3102+
$this->assertEquals(['c', 'd', 'e', 'f'], $data->nth(1, 2)->all());
3103+
$this->assertEquals(['e', 'f'], $data->nth(1, -2)->all());
3104+
$this->assertEquals(['c', 'e'], $data->nth(2, -4)->all());
3105+
$this->assertEquals(['e'], $data->nth(4, -2)->all());
3106+
$this->assertEquals(['e'], $data->nth(2, -2)->all());
31023107
}
31033108

31043109
/**

0 commit comments

Comments
 (0)