Skip to content

Commit 1273311

Browse files
committed
minor #15880 [HttpClient] Update http client testing section (JohnstonCode)
This PR was squashed before being merged into the 4.4 branch. Discussion ---------- [HttpClient] Update http client testing section I have remove all references to MockResponse::getRequestMethod and MockResponse::getRequestUrl as these were added in 5.2 <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `5.x` for features of unreleased versions). --> Commits ------- c86e957 [HttpClient] Update http client testing section
2 parents 587d67b + c86e957 commit 1273311

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

http_client.rst

-10
Original file line numberDiff line numberDiff line change
@@ -1472,8 +1472,6 @@ Testing Request Data
14721472

14731473
The ``MockResponse`` class comes with some helper methods to test the request:
14741474

1475-
* ``getRequestMethod()`` - returns the HTTP method;
1476-
* ``getRequestUrl()`` - returns the URL the request would be sent to;
14771475
* ``getRequestOptions()`` - returns an array containing other information about
14781476
the request such as headers, query parameters, body content etc.
14791477

@@ -1489,12 +1487,6 @@ Usage example::
14891487
],
14901488
]);
14911489

1492-
$mockResponse->getRequestMethod();
1493-
// returns "DELETE"
1494-
1495-
$mockResponse->getRequestUrl();
1496-
// returns "https://example.com/api/article/1337"
1497-
14981490
$mockResponse->getRequestOptions()['headers'];
14991491
// returns ["Accept: */*", "Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l"]
15001492

@@ -1568,8 +1560,6 @@ test it in a real application::
15681560
$responseData = $service->createArticle($requestData);
15691561

15701562
// Assert
1571-
self::assertSame('POST', $mockResponse->getRequestMethod());
1572-
self::assertSame('https://example.com/api/article', $mockResponse->getRequestUrl());
15731563
self::assertContains(
15741564
'Content-Type: application/json',
15751565
$mockResponse->getRequestOptions()['headers']

0 commit comments

Comments
 (0)