Skip to content

Commit 11f1ad2

Browse files
Added tests for empty collections
1 parent 911b637 commit 11f1ad2

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use DragonCode\SizeSorter\SizeSorter;
6+
use Illuminate\Support\Collection;
7+
8+
test('array', function () {
9+
$actual = SizeSorter::items([])->sort()->all();
10+
11+
expect($actual)->toBeEmpty()->toBe([]);
12+
});
13+
14+
test('collection', function () {
15+
$actual = SizeSorter::items(new Collection())->sort()->all();
16+
17+
expect($actual)->toBeEmpty()->toBe([]);
18+
});

0 commit comments

Comments
 (0)