also looking at this
Collection Response
#5
7 files
+42
-51
| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | use Illuminate\Support\Collection; | |
| 3 | 4 | use Meema\LaravelMeema\Facades\Folder; |
| 4 | 5 | use Meema\LaravelMeema\Tests\LaravelMeemaTestCase; |
| 5 | 6 | |
| @@ -13,8 +14,8 @@ beforeEach(function () { | ||
| 13 | 14 | it('can fetch all folders', function () { |
| 14 | 15 | $folders = Folder::get(); |
| 15 | 16 | |
| 16 | $this->assertTrue(is_array($folders)); | |
| 17 | $this->assertTrue(count($folders) > 0); | |
| 17 | $this->assertTrue($folders instanceof Collection); | |
| 18 | $this->assertTrue($folders->count() > 0); | |
| 18 | 19 | }); |
| 19 | 20 | |
| 20 | 21 | it('can search a folder', function () { |
| @@ -24,7 +25,7 @@ it('can search a folder', function () { | ||
| 24 | 25 | |
| 25 | 26 | $folders = Folder::search($query); |
| 26 | 27 | |
| 27 | $this->assertTrue(is_array($folders)); | |
| 28 | $this->assertTrue($folders instanceof Collection); | |
| 28 | 29 | $this->assertTrue(str_contains($folders[0]['name'], $query)); |
| 29 | 30 | }); |
| 30 | 31 | |
| @@ -33,8 +34,8 @@ it('can fetch specific group of folders', function () { | ||
| 33 | 34 | |
| 34 | 35 | $folders = Folder::get($ids); |
| 35 | 36 | |
| 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)); | |
| 38 | 39 | }); |
| 39 | 40 | |
| 40 | 41 | it('can find a single folder', function () { |
| @@ -88,7 +89,7 @@ it('can duplicate a folder', function () { | ||
| 88 | 89 | }); |
| 89 | 90 | |
| 90 | 91 | it('can delete a folder', function () { |
| 91 | $folders = Folder::get(); | |
| 92 | $folders = Folder::get()->toArray(); | |
| 92 | 93 | |
| 93 | 94 | $folders = array_reverse($folders); |
| 94 | 95 | $response = Folder::delete($folders[0]['id']); |