You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor #18607 [HttpClient] Backport HAR files feature (GaryPEGEOT, HeahDude)
This PR was merged into the 6.4 branch.
Discussion
----------
[HttpClient] Backport HAR files feature
#18547 should have been merged in 6.4, I've cherry-picked the commit to backport it, while fixing the version added directive.
Commits
-------
8385108 [HttpClient] fix version added for HAR files feature
948966d [HTTPClient] Add documentation for `HarFileResponseFactory`
Copy file name to clipboardExpand all lines: http_client.rst
+40Lines changed: 40 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2196,6 +2196,45 @@ test it in a real application::
2196
2196
}
2197
2197
}
2198
2198
2199
+
Testing using HAR files
2200
+
~~~~~~~~~~~~~~~~~~~~~~~
2201
+
2202
+
The previous example can also be achieved using `HAR`_ files. You can export those files from all modern browsers (from the network tab) &
2203
+
HTTP Clients. First, do the HTTP request(s) you want to test in your favorite HTTP Client / Browser, then store generated ``.har`` file somewhere in your application::
2204
+
2205
+
// ExternalArticleServiceTest.php
2206
+
use PHPUnit\Framework\TestCase;
2207
+
use Symfony\Component\HttpClient\MockHttpClient;
2208
+
use Symfony\Component\HttpClient\Response\MockResponse;
2209
+
2210
+
final class ExternalArticleServiceTest extends TestCase
0 commit comments