Skip to content

Commit 4dd0b6c

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: Added a deprecated directive The Client class has been replaced by the AbstractBrowser since SF 4.3
2 parents 3bac3fb + 22ccb8f commit 4dd0b6c

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

components/browser_kit.rst

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,23 @@ Creating a Client
3737
~~~~~~~~~~~~~~~~~
3838

3939
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.
4143

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::
4550

4651
namespace Acme;
4752

48-
use Symfony\Component\BrowserKit\Client as BaseClient;
53+
use Symfony\Component\BrowserKit\AbstractBrowser;
4954
use Symfony\Component\BrowserKit\Response;
5055

51-
class Client extends BaseClient
56+
class Client extends AbstractBrowser
5257
{
5358
protected function doRequest($request)
5459
{
@@ -67,7 +72,7 @@ provided by the :doc:`HttpKernel component </components/http_kernel>`.
6772
Making Requests
6873
~~~~~~~~~~~~~~~
6974

70-
Use the :method:`Symfony\\Component\\BrowserKit\\Client::request` method to
75+
Use the :method:`Symfony\\Component\\BrowserKit\\AbstractBrowser::request` method to
7176
make HTTP requests. The first two arguments are the HTTP method and the requested
7277
URL::
7378

@@ -81,7 +86,7 @@ The value returned by the ``request()`` method is an instance of the
8186
:doc:`DomCrawler component </components/dom_crawler>`, which allows accessing
8287
and traversing HTML elements programmatically.
8388

84-
The :method:`Symfony\\Component\\BrowserKit\\Client::xmlHttpRequest` method,
89+
The :method:`Symfony\\Component\\BrowserKit\\AbstractBrowser::xmlHttpRequest` method,
8590
which defines the same arguments as the ``request()`` method, is a shortcut to
8691
make AJAX requests::
8792

0 commit comments

Comments
 (0)