Skip to content

Commit 489acc3

Browse files
committed
Merge branch '4.4' into 5.0
* 4.4: Replace references to Goutte with HttpBrowser
2 parents 9fb4110 + ae2e8af commit 489acc3

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

components/browser_kit.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ This method accepts a request and should return a response::
5959
}
6060

6161
For a simple implementation of a browser based on the HTTP layer, have a look
62-
at `Goutte`_. For an implementation based on ``HttpKernelInterface``, have
63-
a look at the :class:`Symfony\\Component\\HttpKernel\\Client` provided by
64-
the :doc:`HttpKernel component </components/http_kernel>`.
62+
at the :class:`Symfony\\Component\\BrowserKit\\HttpBrowser` provided by
63+
:ref:`this component <component-browserkit-external-requests>`. For an implementation based
64+
on ``HttpKernelInterface``, have a look at the :class:`Symfony\\Component\\HttpKernel\\Client`
65+
provided by the :doc:`HttpKernel component </components/http_kernel>`.
6566

6667
Making Requests
6768
~~~~~~~~~~~~~~~

components/dom_crawler.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -582,23 +582,26 @@ of the information you need to create a POST request for the form::
582582

583583
// now use some HTTP client and post using this information
584584

585-
One great example of an integrated system that uses all of this is `Goutte`_.
586-
Goutte understands the Symfony Crawler object and can use it to submit forms
585+
One great example of an integrated system that uses all of this is
586+
the :class:`Symfony\\Component\\BrowserKit\\HttpBrowser` provided by
587+
the :doc:`BrowserKit component </components/browser_kit>`.
588+
It understands the Symfony Crawler object and can use it to submit forms
587589
directly::
588590

589-
use Goutte\Client;
591+
use Symfony\Component\BrowserKit\HttpBrowser;
592+
use Symfony\Component\HttpClient\HttpClient;
590593

591594
// makes a real request to an external site
592-
$client = new Client();
593-
$crawler = $client->request('GET', 'https://github.com/login');
595+
$browser = new HttpBrowser(HttpClient::create());
596+
$crawler = $browser->request('GET', 'https://github.com/login');
594597

595598
// select the form and fill in some values
596599
$form = $crawler->selectButton('Sign in')->form();
597600
$form['login'] = 'symfonyfan';
598601
$form['password'] = 'anypass';
599602

600603
// submits the given form
601-
$crawler = $client->submit($form);
604+
$crawler = $browser->submit($form);
602605

603606
.. _components-dom-crawler-invalid:
604607

@@ -623,5 +626,4 @@ Learn more
623626
* :doc:`/testing`
624627
* :doc:`/components/css_selector`
625628

626-
.. _`Goutte`: https://github.com/FriendsOfPHP/Goutte
627629
.. _`html5-php library`: https://github.com/Masterminds/html5-php

0 commit comments

Comments
 (0)