| @@ 27-41 (lines=15) @@ | ||
| 24 | /** |
|
| 25 | * @test |
|
| 26 | */ |
|
| 27 | public function getCategories() |
|
| 28 | { |
|
| 29 | $method = 'get'; |
|
| 30 | $url = sprintf(ProductClient::GET_CATEGORIES, self::DEFAULT_ORGANIZATION_UUID); |
|
| 31 | $options = [ |
|
| 32 | 'headers' => [ |
|
| 33 | 'Authorization' => sprintf('Bearer %s', self::ACCESS_TOKEN) |
|
| 34 | ], |
|
| 35 | 'query' => null, |
|
| 36 | ]; |
|
| 37 | ||
| 38 | $productClient = new ProductClient($this->getGuzzleClient($method, $url, $options), $this->getAccessToken()); |
|
| 39 | $categories = $productClient->getCategories(); |
|
| 40 | self::assertTrue(is_array($categories)); |
|
| 41 | } |
|
| 42 | ||
| 43 | /** |
|
| 44 | * @test |
|
| @@ 69-83 (lines=15) @@ | ||
| 66 | /** |
|
| 67 | * @test |
|
| 68 | */ |
|
| 69 | public function getDiscounts() |
|
| 70 | { |
|
| 71 | $method = 'get'; |
|
| 72 | $url = sprintf(ProductClient::GET_DISCOUNTS, self::DEFAULT_ORGANIZATION_UUID); |
|
| 73 | $options = [ |
|
| 74 | 'headers' => [ |
|
| 75 | 'Authorization' => sprintf('Bearer %s', self::ACCESS_TOKEN) |
|
| 76 | ], |
|
| 77 | 'query' => null, |
|
| 78 | ]; |
|
| 79 | ||
| 80 | $productClient = new ProductClient($this->getGuzzleClient($method, $url, $options), $this->getAccessToken()); |
|
| 81 | $discounts = $productClient->getDiscounts(); |
|
| 82 | self::assertTrue(is_array($discounts)); |
|
| 83 | } |
|
| 84 | ||
| 85 | /** |
|
| 86 | * @test |
|
| @@ 163-181 (lines=19) @@ | ||
| 160 | /** |
|
| 161 | * @test |
|
| 162 | */ |
|
| 163 | public function getProducts() |
|
| 164 | { |
|
| 165 | $method = 'get'; |
|
| 166 | $url = sprintf(ProductClient::GET_PRODUCTS, self::DEFAULT_ORGANIZATION_UUID); |
|
| 167 | $options = [ |
|
| 168 | 'headers' => [ |
|
| 169 | 'Authorization' => sprintf('Bearer %s', self::ACCESS_TOKEN) |
|
| 170 | ], |
|
| 171 | 'query' => null, |
|
| 172 | ]; |
|
| 173 | ||
| 174 | $return = [ |
|
| 175 | ||
| 176 | ]; |
|
| 177 | ||
| 178 | $productClient = new ProductClient($this->getGuzzleClient($method, $url, $options, $return), $this->getAccessToken()); |
|
| 179 | $products = $productClient->getProducts(); |
|
| 180 | self::assertTrue(is_array($products)); |
|
| 181 | } |
|
| 182 | ||
| 183 | /** |
|
| 184 | * @test |
|