@@ -66,7 +66,7 @@ public function testDeleteImage()
66
66
return $ return ;
67
67
});
68
68
69
- (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->deleteImage ('image_id ' );
69
+ (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->deleteImage ('image_id ' );
70
70
}
71
71
72
72
public function testDeleteImageWithBadResponseException ()
@@ -97,7 +97,7 @@ public function testDeleteImageWithBadResponseException()
97
97
return $ return ;
98
98
});
99
99
100
- (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->deleteImage ('image_id ' );
100
+ (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->deleteImage ('image_id ' );
101
101
}
102
102
103
103
public function testDeleteImageWithNonBadResponseException ()
@@ -130,7 +130,7 @@ public function testDeleteImageWithNonBadResponseException()
130
130
return $ return ;
131
131
});
132
132
133
- (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->deleteImage ('image_id ' );
133
+ (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->deleteImage ('image_id ' );
134
134
}
135
135
136
136
public function testGetImageUrl ()
@@ -157,7 +157,7 @@ public function testGetImageUrl()
157
157
return $ return ;
158
158
});
159
159
160
- $ this ->assertSame ('https://cdn.optimole.com/image_id ' , (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->getImageUrl ('image_id ' ));
160
+ $ this ->assertSame ('https://cdn.optimole.com/image_id ' , (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->getImageUrl ('image_id ' ));
161
161
}
162
162
163
163
public function testGetImageUrlReturnNullWithBadResponseException ()
@@ -188,7 +188,7 @@ public function testGetImageUrlReturnNullWithBadResponseException()
188
188
return $ return ;
189
189
});
190
190
191
- $ this ->assertNull ((new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->getImageUrl ('image_id ' ));
191
+ $ this ->assertNull ((new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->getImageUrl ('image_id ' ));
192
192
}
193
193
194
194
public function testGetImageUrlWithMissingGetUrlKey ()
@@ -218,7 +218,7 @@ public function testGetImageUrlWithMissingGetUrlKey()
218
218
return $ return ;
219
219
});
220
220
221
- (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->getImageUrl ('image_id ' );
221
+ (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->getImageUrl ('image_id ' );
222
222
}
223
223
224
224
public function testGetUsage ()
@@ -229,7 +229,7 @@ public function testGetUsage()
229
229
->with ($ this ->identicalTo ('POST ' ), $ this ->identicalTo ('https://dashboard_api_url/optml/v2/account/details ' ), $ this ->identicalTo (null ), $ this ->identicalTo (['Authorization ' => 'Bearer optimole_key ' , 'Content-Type ' => 'application/json ' ]))
230
230
->willReturn (['data ' => ['offload_limit ' => 5000 , 'offloaded_images ' => 42 ]]);
231
231
232
- $ usage = (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->getUsage ();
232
+ $ usage = (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->getUsage ();
233
233
234
234
$ this ->assertSame (42 , $ usage ->getCurrent ());
235
235
$ this ->assertSame (5000 , $ usage ->getLimit ());
@@ -246,7 +246,7 @@ public function testGetUsageWithMissingOffloadedImages()
246
246
->with ($ this ->identicalTo ('POST ' ), $ this ->identicalTo ('https://dashboard_api_url/optml/v2/account/details ' ), $ this ->identicalTo (null ), $ this ->identicalTo (['Authorization ' => 'Bearer optimole_key ' , 'Content-Type ' => 'application/json ' ]))
247
247
->willReturn (['data ' => ['offload_limit ' => 5000 ]]);
248
248
249
- (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->getUsage ();
249
+ (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->getUsage ();
250
250
}
251
251
252
252
public function testGetUsageWithMissingOffloadLimit ()
@@ -260,7 +260,7 @@ public function testGetUsageWithMissingOffloadLimit()
260
260
->with ($ this ->identicalTo ('POST ' ), $ this ->identicalTo ('https://dashboard_api_url/optml/v2/account/details ' ), $ this ->identicalTo (null ), $ this ->identicalTo (['Authorization ' => 'Bearer optimole_key ' , 'Content-Type ' => 'application/json ' ]))
261
261
->willReturn (['data ' => ['offloaded_images ' => 42 ]]);
262
262
263
- (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->getUsage ();
263
+ (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->getUsage ();
264
264
}
265
265
266
266
public function testUpdateImageMetadata ()
@@ -275,7 +275,7 @@ public function testUpdateImageMetadata()
275
275
['data ' => ['cdn_key ' => 'cdn_key ' , 'cdn_secret ' => 'cdn_secret ' ]],
276
276
],
277
277
[
278
- ['POST ' , 'https://upload_api_url ' , ['userKey ' => 'cdn_key ' , 'secret ' => 'cdn_secret ' , 'id ' => 'image_id ' , 'originalFileSize ' => 42 , 'height ' => 100 , 'width ' => 200 , 'originalUrl ' => 'originurl ' , 'updateDynamo ' => 'success ' ], ['Content-Type ' => 'application/json ' ]],
278
+ ['POST ' , 'https://upload_api_url ' , ['userKey ' => 'cdn_key ' , 'secret ' => 'cdn_secret ' , 'id ' => 'image_id ' , 'originalFileSize ' => 42 , 'height ' => 100 , 'width ' => 200 , 'originalUrl ' => 'originurl ' , 'updateDynamo ' => 'success ' ], ['Content-Type ' => 'application/json ' ]],
279
279
['success ' ],
280
280
],
281
281
];
@@ -287,7 +287,7 @@ public function testUpdateImageMetadata()
287
287
return $ return ;
288
288
});
289
289
290
- (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->updateImageMetadata ('image_id ' , 42 , 100 , 200 ,'originurl ' );
290
+ (new Manager ($ httpClient , ['dashboard_api_url ' => 'https://dashboard_api_url ' , 'dashboard_api_key ' => 'optimole_key ' , 'upload_api_url ' => 'https://upload_api_url ' ]))->updateImageMetadata ('image_id ' , 42 , 100 , 200 , 'originurl ' );
291
291
}
292
292
293
293
public function testUpdateImageMetadataWithInvalidImageHeight ()
0 commit comments