|
30 | 30 | function curl_exec($ch) |
31 | 31 | { |
32 | 32 | $data = array ('response'=>'{"content": "Mocked response content"}'); |
33 | | - return '{"content": "Mocked response content"}'; |
| 33 | + return '{"content": "Mocked response content"}'; |
34 | 34 | } |
35 | 35 |
|
36 | 36 | function curl_getinfo($ch) |
@@ -232,43 +232,34 @@ public function testEndpoints($filename, $endpoint) |
232 | 232 | // If it does not throw an exception, check that it was not supposed to and if so check that it |
233 | 233 | // returns the correct thing. |
234 | 234 | // If it throws an exception, check that it was supposed to and if so pass otherwise fail test. |
235 | | - //try { |
236 | | - $result = ''; |
237 | | - if ($endpoint === 'categories') { |
238 | | - $result = $api->categories($params); |
239 | | - } |
240 | | - if ($endpoint === 'entities') { |
241 | | - $result = $api->entities($params); |
242 | | - } |
243 | | - if ($endpoint === 'entities_linked') { |
244 | | - $result = $api->entities($params, true); |
245 | | - } |
246 | | - if ($endpoint === 'language') { |
247 | | - $result = $api->language($params); |
248 | | - } |
249 | | - if ($endpoint === 'name-similarity') { |
250 | | - $result = $api->nameSimilarity($params); |
251 | | - } |
252 | | - if ($endpoint === 'morphology_complete') { |
253 | | - $result = $api->morphology($params); |
254 | | - } |
255 | | - if ($endpoint === 'sentiment') { |
256 | | - $result = $api->sentiment($params); |
257 | | - } |
258 | | - if ($endpoint === 'name-translation') { |
259 | | - $result = $api->nameTranslation($params); |
260 | | - } |
261 | | - if ($endpoint === 'relationships') { |
262 | | - $result = $api->relationships($params); |
263 | | - } |
264 | | - // If there is a "code" key, it means an exception should be thrown |
265 | | - //if (!array_key_exists('code', $expected)) { |
266 | | - $this->assertEquals($expected, $result[0]); |
267 | | - |
268 | | - //} |
269 | | - //} catch (RosetteException $exception) { |
270 | | - // $this->assertSame('unsupportedLanguage', $expected['code']); |
271 | | - //} |
| 235 | + $result = ''; |
| 236 | + if ($endpoint === 'categories') { |
| 237 | + $result = $api->categories($params); |
| 238 | + } |
| 239 | + if ($endpoint === 'entities') { |
| 240 | + $result = $api->entities($params); |
| 241 | + } |
| 242 | + if ($endpoint === 'entities_linked') { |
| 243 | + $result = $api->entities($params, true); |
| 244 | + } |
| 245 | + if ($endpoint === 'language') { |
| 246 | + $result = $api->language($params); |
| 247 | + } |
| 248 | + if ($endpoint === 'name-similarity') { |
| 249 | + $result = $api->nameSimilarity($params); |
| 250 | + } |
| 251 | + if ($endpoint === 'morphology_complete') { |
| 252 | + $result = $api->morphology($params); |
| 253 | + } |
| 254 | + if ($endpoint === 'sentiment') { |
| 255 | + $result = $api->sentiment($params); |
| 256 | + } |
| 257 | + if ($endpoint === 'name-translation') { |
| 258 | + $result = $api->nameTranslation($params); |
| 259 | + } |
| 260 | + if ($endpoint === 'relationships') { |
| 261 | + $result = $api->relationships($params); |
| 262 | + } |
| 263 | + $this->assertEquals($expected, $result[0]); |
272 | 264 | } |
273 | | - |
274 | 265 | } |
0 commit comments