also looking at this
Add More Tests
#42
6 files
+170
-26
| @@ -60,12 +60,14 @@ class Tag | ||
| 60 | 60 | return $this->all(); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | if (! is_int($id)) { | |
| 64 | throw new InvalidFormatException(); | |
| 65 | } | |
| 66 | ||
| 67 | 63 | $ids = is_array($id) ? $id : func_get_args(); |
| 68 | 64 | |
| 65 | foreach ($ids as $id) { | |
| 66 | if (! is_int($id)) { | |
| 67 | throw new InvalidFormatException(); | |
| 68 | } | |
| 69 | } | |
| 70 | ||
| 69 | 71 | return $this->client->request('GET', 'tags', ['tag_ids' => $ids]); |
| 70 | 72 | } |
| 71 | 73 | |
| @@ -87,20 +89,6 @@ class Tag | ||
| 87 | 89 | return new Response($this, $response); |
| 88 | 90 | } |
| 89 | 91 | |
| 90 | /** | |
| 91 | * Create folder. | |
| 92 | * | |
| 93 | * @param string $name | |
| 94 | * | |
| 95 | * @return array | |
| 96 | */ | |
| 97 | public function create($name): array | |
| 98 | { | |
| 99 | $name = is_array($name) ? $name : compact('name'); | |
| 100 | ||
| 101 | return $this->client->request('POST', "tags/{$this->client->getAccessKey()}", $name); | |
| 102 | } | |
| 103 | ||
| 104 | 92 | /** |
| 105 | 93 | * Update folder. |
| 106 | 94 | * |
| @@ -109,12 +97,18 @@ class Tag | ||
| 109 | 97 | * |
| 110 | 98 | * @return array |
| 111 | 99 | */ |
| 112 | public function update($id, $data): array | |
| 100 | public function update($id, $color): array | |
| 113 | 101 | { |
| 114 | 102 | if (! is_int($id)) { |
| 115 | 103 | throw new InvalidFormatException(); |
| 116 | 104 | } |
| 117 | 105 | |
| 106 | $data = [ | |
| 107 | 'color' => $color, | |
| 108 | 'tag_id' => $id, | |
| 109 | 'team_id' => 1, | |
| 110 | ]; | |
| 111 | ||
| 118 | 112 | return $this->client->request('PATCH', 'tags/color', $data); |
| 119 | 113 | } |
| 120 | 114 | |