@@ -37,18 +37,23 @@ Creating a Client
37
37
~~~~~~~~~~~~~~~~~
38
38
39
39
The component only provides an abstract client and does not provide any backend
40
- ready to use for the HTTP layer.
40
+ ready to use for the HTTP layer. To create your own client, you must extend the
41
+ ``AbstractBrowser `` class and implement the
42
+ :method: `Symfony\\ Component\\ BrowserKit\\ AbstractBrowser::doRequest ` method.
41
43
42
- To create your own client, you must extend the abstract ``Client `` class and
43
- implement the :method: `Symfony\\ Component\\ BrowserKit\\ Client::doRequest ` method.
44
- This method accepts a request and should return a response::
44
+ .. deprecated :: 4.3
45
+
46
+ In Symfony 4.3 and earlier versions, the ``AbstractBrowser `` class was called
47
+ ``Client `` (which is now deprecated).
48
+
49
+ The ``doRequest() `` method accepts a request and should return a response::
45
50
46
51
namespace Acme;
47
52
48
- use Symfony\Component\BrowserKit\Client as BaseClient ;
53
+ use Symfony\Component\BrowserKit\AbstractBrowser ;
49
54
use Symfony\Component\BrowserKit\Response;
50
55
51
- class Client extends BaseClient
56
+ class Client extends AbstractBrowser
52
57
{
53
58
protected function doRequest($request)
54
59
{
@@ -67,7 +72,7 @@ provided by the :doc:`HttpKernel component </components/http_kernel>`.
67
72
Making Requests
68
73
~~~~~~~~~~~~~~~
69
74
70
- Use the :method: `Symfony\\ Component\\ BrowserKit\\ Client ::request ` method to
75
+ Use the :method: `Symfony\\ Component\\ BrowserKit\\ AbstractBrowser ::request ` method to
71
76
make HTTP requests. The first two arguments are the HTTP method and the requested
72
77
URL::
73
78
@@ -81,7 +86,7 @@ The value returned by the ``request()`` method is an instance of the
81
86
:doc: `DomCrawler component </components/dom_crawler >`, which allows accessing
82
87
and traversing HTML elements programmatically.
83
88
84
- The :method: `Symfony\\ Component\\ BrowserKit\\ Client ::xmlHttpRequest ` method,
89
+ The :method: `Symfony\\ Component\\ BrowserKit\\ AbstractBrowser ::xmlHttpRequest ` method,
85
90
which defines the same arguments as the ``request() `` method, is a shortcut to
86
91
make AJAX requests::
87
92
0 commit comments