also looking at this
WIP: Upload Endpoint
#38
6 files
+172
-94
| @@ -14,6 +14,16 @@ it('can be fetch all media', function () { | ||
| 14 | 14 | $this->assertTrue(count($media) > 0); |
| 15 | 15 | }); |
| 16 | 16 | |
| 17 | it('can search a media', function () { | |
| 18 | $media = $this->client->media()->find(1)->toArray(); | |
| 19 | $query = $media['data']['name']; | |
| 20 | ||
| 21 | $media = $this->client->media()->search($query); | |
| 22 | ||
| 23 | $this->assertTrue(is_array($media)); | |
| 24 | $this->assertTrue(str_contains($media['data'][0]['name'], $query)); | |
| 25 | }); | |
| 26 | ||
| 17 | 27 | it('can be fetch all media for a tag', function () { |
| 18 | 28 | // 8 is the tag id for images |
| 19 | 29 | $tag = $this->client->tags()->find(8); |
| @@ -61,16 +71,6 @@ it('can update a media', function () { | ||
| 61 | 71 | $this->assertTrue($media['data']['name'] === $name); |
| 62 | 72 | }); |
| 63 | 73 | |
| 64 | it('can search a media', function () { | |
| 65 | $mediaName = $this->client->media()->find(1)->toArray(); | |
| 66 | $query = $mediaName['name']; | |
| 67 | ||
| 68 | $media = $this->client->media()->search($query); | |
| 69 | ||
| 70 | $this->assertTrue(is_array($media)); | |
| 71 | $this->assertTrue(str_contains($media['data'][0]['name'], $query)); | |
| 72 | }); | |
| 73 | ||
| 74 | 74 | it('can archive a media', function () { |
| 75 | 75 | $media = $this->client->media()->archive(1); |
| 76 | 76 | |