@@ -1478,9 +1478,9 @@ to also test the request itself? ``MockResponse`` comes with helper methods:
1478
1478
Usage example::
1479
1479
1480
1480
$mockResponse = new MockResponse('', ['http_code' => 204]);
1481
- $httpClient = new MockHttpClient($mockResponse, 'https://example.com/ ');
1481
+ $httpClient = new MockHttpClient($mockResponse, 'https://example.com');
1482
1482
1483
- $response = $httpClient->request('DELETE', '/ api/article/1337', [
1483
+ $response = $httpClient->request('DELETE', 'api/article/1337', [
1484
1484
'headers' => [
1485
1485
'Accept: */*',
1486
1486
'Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l',
@@ -1490,7 +1490,7 @@ Usage example::
1490
1490
// returns "DELETE"
1491
1491
$mockResponse->getRequestMethod();
1492
1492
1493
- // returns "https://example.com// api/article/1337"
1493
+ // returns "https://example.com/api/article/1337"
1494
1494
$mockResponse->getRequestUrl();
1495
1495
1496
1496
// returns ["Accept: */*", "Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l"]
@@ -1559,7 +1559,7 @@ test it in real application::
1559
1559
'response_headers' => ['Content-Type: application/json'],
1560
1560
]);
1561
1561
1562
- $httpClient = new MockHttpClient($mockResponse, 'https://example.com/ ');
1562
+ $httpClient = new MockHttpClient($mockResponse, 'https://example.com');
1563
1563
$service = new ExternalArticleService($httpClient);
1564
1564
1565
1565
// Act
0 commit comments