also looking at this
Modify tests
#40
2 files
+13
-21
| @@ -50,14 +50,14 @@ it('can update a folder', function () { | ||
| 50 | 50 | $this->assertTrue($folders['data']['name'] === $name); |
| 51 | 51 | }); |
| 52 | 52 | |
| 53 | // it('can search a folder', function () { | |
| 54 | // $query = 'Invoice'; | |
| 53 | it('can search a folder', function () { | |
| 54 | $query = 'Invoice'; | |
| 55 | 55 | |
| 56 | // $folders = $this->client->folders()->search($query); | |
| 56 | $folders = $this->client->folders()->search($query); | |
| 57 | 57 | |
| 58 | // $this->assertTrue(is_array($folders)); | |
| 59 | // $this->assertTrue(str_contains($folders['data'][0]['name'], $query)); | |
| 60 | // }); | |
| 58 | $this->assertTrue(is_array($folders)); | |
| 59 | $this->assertTrue(str_contains($folders['data'][0]['name'], $query)); | |
| 60 | }); | |
| 61 | 61 | |
| 62 | 62 | it('can archive a folder', function () { |
| 63 | 63 | $folders = $this->client->folders()->archive(1); |
| @@ -41,18 +41,16 @@ it('can update a media', function () { | ||
| 41 | 41 | $this->assertTrue($media['data']['name'] === $name); |
| 42 | 42 | }); |
| 43 | 43 | |
| 44 | // it('can search a media', function () { | |
| 45 | // $query = 'michael'; | |
| 44 | it('can search a media', function () { | |
| 45 | $query = 'people'; | |
| 46 | 46 | |
| 47 | // $media = $this->client->media()->search($query); | |
| 47 | $media = $this->client->media()->search($query); | |
| 48 | 48 | |
| 49 | // $this->assertTrue(is_array($media)); | |
| 50 | // $this->assertTrue(str_contains($media['data'][0]['name'], $query)); | |
| 51 | // }); | |
| 49 | $this->assertTrue(is_array($media)); | |
| 50 | $this->assertTrue(str_contains($media['data'][0]['name'], $query)); | |
| 51 | }); | |
| 52 | 52 | |
| 53 | 53 | it('can archive a media', function () { |
| 54 | $query = 'michael'; | |
| 55 | ||
| 56 | 54 | $media = $this->client->media()->archive(1); |
| 57 | 55 | |
| 58 | 56 | $this->assertTrue(is_array($media)); |
| @@ -60,8 +58,6 @@ it('can archive a media', function () { | ||
| 60 | 58 | }); |
| 61 | 59 | |
| 62 | 60 | it('can unarchive a media', function () { |
| 63 | $query = 'michael'; | |
| 64 | ||
| 65 | 61 | $media = $this->client->media()->unarchive(1); |
| 66 | 62 | |
| 67 | 63 | $this->assertTrue(is_array($media)); |
| @@ -69,8 +65,6 @@ it('can unarchive a media', function () { | ||
| 69 | 65 | }); |
| 70 | 66 | |
| 71 | 67 | it('can make a media private', function () { |
| 72 | $query = 'michael'; | |
| 73 | ||
| 74 | 68 | $media = $this->client->media()->makePrivate(1); |
| 75 | 69 | |
| 76 | 70 | $this->assertTrue(is_array($media)); |
| @@ -78,8 +72,6 @@ it('can make a media private', function () { | ||
| 78 | 72 | }); |
| 79 | 73 | |
| 80 | 74 | it('can make a media public', function () { |
| 81 | $query = 'michael'; | |
| 82 | ||
| 83 | 75 | $media = $this->client->media()->makePublic(1); |
| 84 | 76 | |
| 85 | 77 | $this->assertTrue(is_array($media)); |
| @@ -99,7 +91,7 @@ it('can delete a media', function () { | ||
| 99 | 91 | $media = $this->client->media()->get(); |
| 100 | 92 | |
| 101 | 93 | $media = array_reverse($media['data']); |
| 102 | $response = $this->client->media()->delete((int) $media[0]['upload_id']); | |
| 94 | $response = $this->client->media()->delete((int) $media[0]['media_id']); | |
| 103 | 95 | |
| 104 | 96 | $this->assertTrue(is_null($response)); |
| 105 | 97 | }); |