also looking at this
Remove "data" in array response
#47
5 files
+40
-34
| @@ -20,7 +20,7 @@ it('can fetch specific group of tags', function () { | ||
| 20 | 20 | $tags = $this->client->tags()->get($ids); |
| 21 | 21 | |
| 22 | 22 | $this->assertTrue(is_array($tags)); |
| 23 | $this->assertTrue(count($tags['data']) === count($ids)); | |
| 23 | $this->assertTrue(count($tags) === count($ids)); | |
| 24 | 24 | }); |
| 25 | 25 | |
| 26 | 26 | it('can find a single tag', function () { |
| @@ -29,7 +29,7 @@ it('can find a single tag', function () { | ||
| 29 | 29 | $tags = $this->client->tags()->find($id)->toArray(); |
| 30 | 30 | |
| 31 | 31 | $this->assertTrue(is_array($tags)); |
| 32 | $this->assertTrue(count($tags) === 1); | |
| 32 | $this->assertTrue(array_key_exists('id', $tags)); | |
| 33 | 33 | }); |
| 34 | 34 | |
| 35 | 35 | it('can update a tag', function () { |
| @@ -38,13 +38,13 @@ it('can update a tag', function () { | ||
| 38 | 38 | $tags = $this->client->tags()->update(7, $color); |
| 39 | 39 | |
| 40 | 40 | $this->assertTrue(is_array($tags)); |
| 41 | $this->assertTrue($tags['data']['color'] === $color); | |
| 41 | $this->assertTrue($tags['color'] === $color); | |
| 42 | 42 | }); |
| 43 | 43 | |
| 44 | 44 | it('can delete a tag', function () { |
| 45 | 45 | $tags = $this->client->tags()->get(); |
| 46 | 46 | |
| 47 | $tags = array_reverse($tags['data']); | |
| 47 | $tags = array_reverse($tags); | |
| 48 | 48 | $response = $this->client->tags()->delete($tags[0]['id']); |
| 49 | 49 | |
| 50 | 50 | $this->assertTrue(is_null($response)); |
| @@ -55,7 +55,7 @@ it('can fetch all media tags', function () { | ||
| 55 | 55 | $tags = $media->tags()->get(); |
| 56 | 56 | |
| 57 | 57 | $this->assertTrue(is_array($tags)); |
| 58 | $this->assertTrue(count($tags['data'][0]) > 0); | |
| 58 | $this->assertTrue(count($tags[0]) > 0); | |
| 59 | 59 | }); |
| 60 | 60 | |
| 61 | 61 | it('can fetch all folder tags', function () { |
| @@ -63,5 +63,5 @@ it('can fetch all folder tags', function () { | ||
| 63 | 63 | $tags = $folder->tags()->get(); |
| 64 | 64 | |
| 65 | 65 | $this->assertTrue(is_array($tags)); |
| 66 | $this->assertTrue(count($tags['data'][0]) > 0); | |
| 66 | $this->assertTrue(count($tags[0]) > 0); | |
| 67 | 67 | }); |