ReviewOS

also looking at this

meemalabs/laravel-meema

Collection Response

#5
Merged glennmichael123 wants to merge collection-response into main
7 files +42 -51

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

tests/FavoriteTest.phpmodified+2-2
Changes to tests/FavoriteTest.php
@@ -15,7 +15,7 @@ it('can fetch all favorites', function () {
1515 $favorites = Favorite::get();
1616
1717 $this->assertTrue($favorites instanceof Collection);
18 $this->assertTrue(count($favorites) > 0);
18 $this->assertTrue($favorites->count() > 0);
1919});
2020
2121it('can fetch specific group of favorites', function () {
@@ -24,7 +24,7 @@ it('can fetch specific group of favorites', function () {
2424 $favorites = Favorite::get($ids);
2525
2626 $this->assertTrue($favorites instanceof Collection);
27 $this->assertTrue(count($favorites) === count($ids));
27 $this->assertTrue($favorites->count() === count($ids));
2828});
2929
3030it('can find a single favorite', function () {
tests/FolderTest.phpmodified+2-2
Changes to tests/FolderTest.php
@@ -15,7 +15,7 @@ it('can fetch all folders', function () {
1515 $folders = Folder::get();
1616
1717 $this->assertTrue($folders instanceof Collection);
18 $this->assertTrue(count($folders) > 0);
18 $this->assertTrue($folders->count() > 0);
1919});
2020
2121it('can search a folder', function () {
@@ -35,7 +35,7 @@ it('can fetch specific group of folders', function () {
3535 $folders = Folder::get($ids);
3636
3737 $this->assertTrue($folders instanceof Collection);
38 $this->assertTrue(count($folders) === count($ids));
38 $this->assertTrue($folders->count() === count($ids));
3939});
4040
4141it('can find a single folder', function () {
tests/MediaTest.phpmodified+4-4
Changes to tests/MediaTest.php
@@ -17,7 +17,7 @@ it('can be fetch all media', function () {
1717 $media = Media::get();
1818
1919 $this->assertTrue($media instanceof Collection);
20 $this->assertTrue(count($media) > 0);
20 $this->assertTrue($media->count() > 0);
2121});
2222
2323it('can search a media', function () {
@@ -37,7 +37,7 @@ it('can be fetch all media for a tag', function () {
3737 $media = $tag->media()->get();
3838
3939 $this->assertTrue($media instanceof Collection);
40 $this->assertTrue(count($media) > 0);
40 $this->assertTrue($media->count() > 0);
4141});
4242
4343it('can be fetch all media for a folder', function () {
@@ -47,7 +47,7 @@ it('can be fetch all media for a folder', function () {
4747 $media = $folder->media()->get();
4848
4949 $this->assertTrue($media instanceof Collection);
50 $this->assertTrue(count($media) > 0);
50 $this->assertTrue($media->count() > 0);
5151});
5252
5353it('can be fetch specific group of media', function () {
@@ -56,7 +56,7 @@ it('can be fetch specific group of media', function () {
5656 $media = Media::get($ids);
5757
5858 $this->assertTrue($media instanceof Collection);
59 $this->assertTrue(count($media) === count($ids));
59 $this->assertTrue($media->count() === count($ids));
6060});
6161
6262it('can find a single media', function () {
tests/TagTest.phpmodified+3-3
Changes to tests/TagTest.php
@@ -17,7 +17,7 @@ it('can fetch all tags', function () {
1717 $tags = Tag::get();
1818
1919 $this->assertTrue($tags instanceof Collection);
20 $this->assertTrue(count($tags) > 0);
20 $this->assertTrue($tags->count() > 0);
2121});
2222
2323it('can fetch specific group of tags', function () {
@@ -26,7 +26,7 @@ it('can fetch specific group of tags', function () {
2626 $tags = Tag::get($ids);
2727
2828 $this->assertTrue($tags instanceof Collection);
29 $this->assertTrue(count($tags) === count($ids));
29 $this->assertTrue($tags->count() === count($ids));
3030});
3131
3232it('can find a single tag', function () {
@@ -52,7 +52,7 @@ it('can fetch all media tags', function () {
5252 $tags = $media->tags()->get();
5353
5454 $this->assertTrue($tags instanceof Collection);
55 $this->assertTrue(count($tags[0]) > 0);
55 $this->assertTrue($tags->count() >= 0);
5656});
5757
5858it('can fetch all folder tags', function () {