[BaseCollection] Fix incorrectly working limit() method

This commit is contained in:
Meritoo
2021-04-11 21:45:29 +02:00
parent 0d3265d7b6
commit 1eb86cf102
4 changed files with 12 additions and 17 deletions

View File

@@ -724,33 +724,24 @@ class BaseCollectionTest extends BaseTestCase
2,
];
yield 'Maximum set to 1 & offset smaller than size of collection' => [
yield 'Maximum set to 1 & offset set to 2' => [
[
'lorem',
'ipsum',
123 => 'dolor',
],
1,
2,
];
yield 'Maximum set to 1 & offset equal size of collection' => [
yield 'Maximum set to 1 & offset set to 3' => [
[
'lorem',
'ipsum',
123 => 'dolor',
345 => 'sit',
],
1,
4,
3,
];
yield 'Maximum set to 1 & offset greater than size of collection' => [
[
'lorem',
'ipsum',
123 => 'dolor',
345 => 'sit',
],
yield 'Maximum set to 1 & offset set to 10' => [
[],
1,
10,
];