ReviewOS

also looking at this

meemalabs/laravel-meema

Collection Response

#5
Merged glennmichael123 wants to merge collection-response into main
7 files +42 -51
tests/FolderTest.phpmodified+7-6
Changes to tests/FolderTest.php
@@ -1,5 +1,6 @@
11<?php
22
3use Illuminate\Support\Collection;
34use Meema\LaravelMeema\Facades\Folder;
45use Meema\LaravelMeema\Tests\LaravelMeemaTestCase;
56
@@ -13,8 +14,8 @@ beforeEach(function () {
1314it('can fetch all folders', function () {
1415 $folders = Folder::get();
1516
16 $this->assertTrue(is_array($folders));
17 $this->assertTrue(count($folders) > 0);
17 $this->assertTrue($folders instanceof Collection);
18 $this->assertTrue($folders->count() > 0);
1819});
1920
2021it('can search a folder', function () {
@@ -24,7 +25,7 @@ it('can search a folder', function () {
2425
2526 $folders = Folder::search($query);
2627
27 $this->assertTrue(is_array($folders));
28 $this->assertTrue($folders instanceof Collection);
2829 $this->assertTrue(str_contains($folders[0]['name'], $query));
2930});
3031
@@ -33,8 +34,8 @@ it('can fetch specific group of folders', function () {
3334
3435 $folders = Folder::get($ids);
3536
36 $this->assertTrue(is_array($folders));
37 $this->assertTrue(count($folders) === count($ids));
37 $this->assertTrue($folders instanceof Collection);
38 $this->assertTrue($folders->count() === count($ids));
3839});
3940
4041it('can find a single folder', function () {
@@ -88,7 +89,7 @@ it('can duplicate a folder', function () {
8889});
8990
9091it('can delete a folder', function () {
91 $folders = Folder::get();
92 $folders = Folder::get()->toArray();
9293
9394 $folders = array_reverse($folders);
9495 $response = Folder::delete($folders[0]['id']);