also looking at this
Remove "data" in array response
#47
5 files
+40
-34
| @@ -20,7 +20,7 @@ it('can fetch specific group of favorites', function () { | ||
| 20 | 20 | $favorites = $this->client->favorites()->get($ids); |
| 21 | 21 | |
| 22 | 22 | $this->assertTrue(is_array($favorites)); |
| 23 | $this->assertTrue(count($favorites['data']) === count($ids)); | |
| 23 | $this->assertTrue(count($favorites) === count($ids)); | |
| 24 | 24 | }); |
| 25 | 25 | |
| 26 | 26 | it('can find a single favorite', function () { |
| @@ -29,7 +29,7 @@ it('can find a single favorite', function () { | ||
| 29 | 29 | $favorites = $this->client->favorites()->find($id)->toArray(); |
| 30 | 30 | |
| 31 | 31 | $this->assertTrue(is_array($favorites)); |
| 32 | $this->assertTrue(count($favorites) === 1); | |
| 32 | $this->assertTrue(array_key_exists('id', $favorites)); | |
| 33 | 33 | }); |
| 34 | 34 | |
| 35 | 35 | it('can create a favorite', function () { |
| @@ -38,7 +38,7 @@ it('can create a favorite', function () { | ||
| 38 | 38 | $favorite = $this->client->favorites()->create($data); |
| 39 | 39 | |
| 40 | 40 | $this->assertTrue(is_array($favorite)); |
| 41 | $this->assertTrue($favorite['data']['name'] === $data['name']); | |
| 41 | $this->assertTrue($favorite['name'] === $data['name']); | |
| 42 | 42 | }); |
| 43 | 43 | |
| 44 | 44 | it('can update a favorite', function () { |
| @@ -47,13 +47,13 @@ it('can update a favorite', function () { | ||
| 47 | 47 | $favorites = $this->client->favorites()->update(7, $data); |
| 48 | 48 | |
| 49 | 49 | $this->assertTrue(is_array($favorites)); |
| 50 | $this->assertTrue($favorites['data']['name'] === $data['name']); | |
| 50 | $this->assertTrue($favorites['name'] === $data['name']); | |
| 51 | 51 | }); |
| 52 | 52 | |
| 53 | 53 | it('can delete a favorite', function () { |
| 54 | 54 | $favorites = $this->client->tags()->get(); |
| 55 | 55 | |
| 56 | $favorites = array_reverse($favorites['data']); | |
| 56 | $favorites = array_reverse($favorites); | |
| 57 | 57 | $response = $this->client->tags()->delete($favorites[0]['id']); |
| 58 | 58 | |
| 59 | 59 | $this->assertTrue(is_null($response)); |