ReviewOS

also looking at this

meemalabs/meema-client-php

WIP: Upload Endpoint

#38
Merged glennmichael123 wants to merge upload-endpoint into main
6 files +172 -94
tests/MeemaMediaTest.phpmodified+10-10
Changes to tests/MeemaMediaTest.php
@@ -14,6 +14,16 @@ it('can be fetch all media', function () {
1414 $this->assertTrue(count($media) > 0);
1515});
1616
17it('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
1727it('can be fetch all media for a tag', function () {
1828 // 8 is the tag id for images
1929 $tag = $this->client->tags()->find(8);
@@ -61,16 +71,6 @@ it('can update a media', function () {
6171 $this->assertTrue($media['data']['name'] === $name);
6272});
6373
64it('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
7474it('can archive a media', function () {
7575 $media = $this->client->media()->archive(1);
7676