From a3ff4e04e1db26fbb9d51fb2a2928ea98fcd4bb4 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Tue, 14 Apr 2020 17:16:51 +0200 Subject: [PATCH] The Client class has been replaced by the AbstractBrowser since SF 4.3 --- components/browser_kit.rst | 12 ++++++------ testing.rst | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/browser_kit.rst b/components/browser_kit.rst index 8108bf8f816..c32dbd92f53 100644 --- a/components/browser_kit.rst +++ b/components/browser_kit.rst @@ -39,16 +39,16 @@ Creating a Client The component only provides an abstract client and does not provide any backend ready to use for the HTTP layer. -To create your own client, you must extend the abstract ``Client`` class and -implement the :method:`Symfony\\Component\\BrowserKit\\Client::doRequest` method. +To create your own client, you must extend the ``AbstractBrowser`` class and +implement the :method:`Symfony\\Component\\BrowserKit\\AbstractBrowser::doRequest` method. This method accepts a request and should return a response:: namespace Acme; - use Symfony\Component\BrowserKit\Client as BaseClient; + use Symfony\Component\BrowserKit\AbstractBrowser; use Symfony\Component\BrowserKit\Response; - class Client extends BaseClient + class Client extends AbstractBrowser { protected function doRequest($request) { @@ -67,7 +67,7 @@ provided by the :doc:`HttpKernel component `. Making Requests ~~~~~~~~~~~~~~~ -Use the :method:`Symfony\\Component\\BrowserKit\\Client::request` method to +Use the :method:`Symfony\\Component\\BrowserKit\\AbstractBrowser::request` method to make HTTP requests. The first two arguments are the HTTP method and the requested URL:: @@ -81,7 +81,7 @@ The value returned by the ``request()`` method is an instance of the :doc:`DomCrawler component `, which allows accessing and traversing HTML elements programmatically. -The :method:`Symfony\\Component\\BrowserKit\\Client::xmlHttpRequest` method, +The :method:`Symfony\\Component\\BrowserKit\\AbstractBrowser::xmlHttpRequest` method, which defines the same arguments as the ``request()`` method, is a shortcut to make AJAX requests:: diff --git a/testing.rst b/testing.rst index c0f68bc8e4c..701b79dd1a3 100644 --- a/testing.rst +++ b/testing.rst @@ -484,7 +484,7 @@ script:: AJAX Requests ~~~~~~~~~~~~~ -The Client provides a :method:`Symfony\\Component\\BrowserKit\\Client::xmlHttpRequest` +The Client provides a :method:`Symfony\\Component\\BrowserKit\\AbstractBrowser::xmlHttpRequest` method, which has the same arguments as the ``request()`` method, and it's a shortcut to make AJAX requests:: pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy