Skip to content

Commit a5118b7

Browse files
committed
Merge pull request #5 from megazoll/fix-guzzle-update
Fix Response namespace
2 parents 9c1792b + 88751ee commit a5118b7

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/Client.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use GuzzleHttp\Client as HttpClient;
44
use GuzzleHttp\Exception\ClientException as HttpClientException;
5-
use GuzzleHttp\Message\Response;
5+
use GuzzleHttp\Psr7\Response;
66

77
class Client
88
{

tests/src/UberTest.php

+13-13
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function test_Get_Products()
128128

129129
$this->client->setAccessToken(null);
130130

131-
$getResponse = m::mock('GuzzleHttp\Message\Response');
131+
$getResponse = m::mock('GuzzleHttp\Psr7\Response');
132132
$getResponse->shouldReceive('getBody')->times(1)->andReturn('{"products": [{"product_id": "327f7914-cd12-4f77-9e0c-b27bac580d03","description": "The original Uber","display_name": "UberBLACK","capacity": 4,"image": "http://..."},{"product_id": "955b92da-2b90-4f32-9586-f766cee43b99","description": "Room for everyone","display_name": "UberSUV","capacity": 6,"image": "http://..."},{"product_id": "622237e-c1e4-4523-b6e7-e1ac53f625ed","description": "Taxi without the hassle","display_name": "uberTAXI","capacity": 4,"image": "http://..."},{"product_id": "b5e74e96-5d27-4caf-83e9-54c030cd6ac5","description": "The low-cost Uber","display_name": "uberX","capacity": 4,"image": "http://..."}]}');
133133
$getResponse->shouldReceive('getHeader')->times(3)->andReturnValues([1000, 955, strtotime("+1 day")]);
134134

@@ -147,7 +147,7 @@ public function test_Get_Product()
147147
{
148148
$product_id = 'mock_product_id';
149149

150-
$getResponse = m::mock('GuzzleHttp\Message\Response');
150+
$getResponse = m::mock('GuzzleHttp\Psr7\Response');
151151
$getResponse->shouldReceive('getBody')->times(1)->andReturn('{"product_id": "'.$product_id.'","description": "The original Uber","display_name": "UberBLACK","capacity": 4,"image": "http://..."}');
152152
$getResponse->shouldReceive('getHeader')->times(3)->andReturnValues([1000, 955, strtotime("+1 day")]);
153153

@@ -170,7 +170,7 @@ public function test_Get_Price_Estimates()
170170
'end_longitude' => '-87.67126465',
171171
];
172172

173-
$getResponse = m::mock('GuzzleHttp\Message\Response');
173+
$getResponse = m::mock('GuzzleHttp\Psr7\Response');
174174
$getResponse->shouldReceive('getBody')->times(1)->andReturn('{"prices": [{"product_id": "08f17084-23fd-4103-aa3e-9b660223934b","currency_code": "USD","display_name": "UberBLACK","estimate": "$23-29","low_estimate": 23,"high_estimate": 29,"surge_multiplier": 1,"duration": 640,"distance": 5.34},{"product_id": "9af0174c-8939-4ef6-8e91-1a43a0e7c6f6","currency_code": "USD","display_name": "UberSUV","estimate": "$36-44","low_estimate": 36,"high_estimate": 44,"surge_multiplier": 1.25,"duration": 640,"distance": 5.34},{"product_id": "aca52cea-9701-4903-9f34-9a2395253acb","currency_code": null,"display_name": "uberTAXI","estimate": "Metered","low_estimate": null,"high_estimate": null,"surge_multiplier": 1,"duration": 640,"distance": 5.34},{"product_id": "a27a867a-35f4-4253-8d04-61ae80a40df5","currency_code": "USD","display_name": "uberX","estimate": "$15","low_estimate": 15,"high_estimate": 15,"surge_multiplier": 1,"duration": 640,"distance": 5.34}]}');
175175
$getResponse->shouldReceive('getHeader')->times(3)->andReturnValues([1000, 955, strtotime("+1 day")]);
176176

@@ -191,7 +191,7 @@ public function test_Get_Time_Estimates()
191191
'start_longitude' => '-87.62730337',
192192
];
193193

194-
$getResponse = m::mock('GuzzleHttp\Message\Response');
194+
$getResponse = m::mock('GuzzleHttp\Psr7\Response');
195195
$getResponse->shouldReceive('getBody')->times(1)->andReturn('{"times": [{"product_id": "5f41547d-805d-4207-a297-51c571cf2a8c","display_name": "UberBLACK","estimate": 410},{"product_id": "694558c9-b34b-4836-855d-821d68a4b944","display_name": "UberSUV","estimate": 535},{"product_id": "65af3521-a04f-4f80-8ce2-6d88fb6648bc","display_name": "uberTAXI","estimate": 294},{"product_id": "17b011d3-65be-421d-adf6-a5480a366453","display_name": "uberX","estimate": 288}]}');
196196
$getResponse->shouldReceive('getHeader')->times(3)->andReturnValues([1000, 955, strtotime("+1 day")]);
197197

@@ -214,7 +214,7 @@ public function test_Get_Promotions()
214214
'end_longitude' => '-87.67126465',
215215
];
216216

217-
$getResponse = m::mock('GuzzleHttp\Message\Response');
217+
$getResponse = m::mock('GuzzleHttp\Psr7\Response');
218218
$getResponse->shouldReceive('getBody')->times(1)->andReturn('{"display_text": "Free ride up to $30","localized_value": "$30","type": "trip_credit"}');
219219
$getResponse->shouldReceive('getHeader')->times(3)->andReturnValues([1000, 955, strtotime("+1 day")]);
220220

@@ -237,7 +237,7 @@ public function test_Get_History()
237237

238238
$this->client->setVersion('v1.1');
239239

240-
$getResponse = m::mock('GuzzleHttp\Message\Response');
240+
$getResponse = m::mock('GuzzleHttp\Psr7\Response');
241241
$getResponse->shouldReceive('getBody')->times(1)->andReturn('{"offset": 0,"limit": 1,"count": 5,"history": [{"uuid": "7354db54-cc9b-4961-81f2-0094b8e2d215","request_time": 1401884467,"product_id": "edf5e5eb-6ae6-44af-bec6-5bdcf1e3ed2c","status": "completed","distance": 0.0279562,"start_time": 1401884646,"end_time": 1401884732}]}');
242242
$getResponse->shouldReceive('getHeader')->times(3)->andReturnValues([1000, 955, strtotime("+1 day")]);
243243

@@ -253,7 +253,7 @@ public function test_Get_History()
253253

254254
public function test_Get_Profile()
255255
{
256-
$getResponse = m::mock('GuzzleHttp\Message\Response');
256+
$getResponse = m::mock('GuzzleHttp\Psr7\Response');
257257
$getResponse->shouldReceive('getBody')->times(1)->andReturn('{"first_name": "Uber","last_name": "Developer","email": "[email protected]","picture": "https://...","promo_code": "teypo","uuid": "91d81273-45c2-4b57-8124-d0165f8240c0"}');
258258
$getResponse->shouldReceive('getHeader')->times(3)->andReturnValues([1000, 955, strtotime("+1 day")]);
259259

@@ -279,7 +279,7 @@ public function test_Request_Ride()
279279

280280
$this->client->setUseSandbox(true);
281281

282-
$postResponse = m::mock('GuzzleHttp\Message\Response');
282+
$postResponse = m::mock('GuzzleHttp\Psr7\Response');
283283
$postResponse->shouldReceive('getBody')->times(1)->andReturn('{"request_id": "852b8fdd-4369-4659-9628-e122662ad257","status": "processing","vehicle": null,"driver": null,"location": null,"eta": 5,"surge_multiplier": null}');
284284
$postResponse->shouldReceive('getHeader')->times(3)->andReturnValues([1000, 955, strtotime("+1 day")]);
285285

@@ -297,7 +297,7 @@ public function test_Get_Request()
297297
{
298298
$request_id = 'mock_request_id';
299299

300-
$getResponse = m::mock('GuzzleHttp\Message\Response');
300+
$getResponse = m::mock('GuzzleHttp\Psr7\Response');
301301
$getResponse->shouldReceive('getBody')->times(1)->andReturn('{"request_id": "'.$request_id.'","status": "processing","vehicle": null,"driver": null,"location": null,"eta": 5,"surge_multiplier": null}');
302302
$getResponse->shouldReceive('getHeader')->times(3)->andReturnValues([1000, 955, strtotime("+1 day")]);
303303

@@ -315,7 +315,7 @@ public function test_Get_Request_Map()
315315
{
316316
$request_id = 'mock_request_id';
317317

318-
$getResponse = m::mock('GuzzleHttp\Message\Response');
318+
$getResponse = m::mock('GuzzleHttp\Psr7\Response');
319319
$getResponse->shouldReceive('getBody')->times(1)->andReturn('{"request_id":"'.$request_id.'","href":"https://trip.uber.com/abc123"}');
320320
$getResponse->shouldReceive('getHeader')->times(3)->andReturnValues([1000, 955, strtotime("+1 day")]);
321321

@@ -333,7 +333,7 @@ public function test_Cancel_Request()
333333
{
334334
$request_id = 'mock_request_id';
335335

336-
$getResponse = m::mock('GuzzleHttp\Message\Response');
336+
$getResponse = m::mock('GuzzleHttp\Psr7\Response');
337337
$getResponse->shouldReceive('getBody')->times(1)->andReturn(null);
338338
$getResponse->shouldReceive('getHeader')->times(3)->andReturnValues([1000, 955, strtotime("+1 day")]);
339339

@@ -359,7 +359,7 @@ public function test_Set_Request()
359359
$request_id = 'mock_request_id';
360360
$request_body = ['status' => uniqid()];
361361

362-
$getResponse = m::mock('GuzzleHttp\Message\Response');
362+
$getResponse = m::mock('GuzzleHttp\Psr7\Response');
363363
$getResponse->shouldReceive('getBody')->times(1)->andReturn(null);
364364
$getResponse->shouldReceive('getHeader')->times(3)->andReturnValues([1000, 955, strtotime("+1 day")]);
365365

@@ -378,7 +378,7 @@ public function test_Set_Product()
378378
$product_id = 'mock_request_id';
379379
$request_body = ['surge_multiplier' => uniqid()];
380380

381-
$getResponse = m::mock('GuzzleHttp\Message\Response');
381+
$getResponse = m::mock('GuzzleHttp\Psr7\Response');
382382
$getResponse->shouldReceive('getBody')->times(1)->andReturn(null);
383383
$getResponse->shouldReceive('getHeader')->times(3)->andReturnValues([1000, 955, strtotime("+1 day")]);
384384

0 commit comments

Comments
 (0)