Skip to content

Commit 4f6be4d

Browse files
committed
Add the documentation about the BrowserKitDriver
1 parent bf29544 commit 4f6be4d

3 files changed

Lines changed: 48 additions & 1 deletion

File tree

drivers/browserkit.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
BrowserKitDriver
2+
================
3+
4+
BrowserKitDriver provides a bridge for the `Symfony BrowserKit`_ component.
5+
BrowserKit is a browser emulator provided by the `Symfony project`_.
6+
7+
Installation
8+
------------
9+
10+
BrowserKitDriver is a pure PHP library available through Composer:
11+
12+
.. code-block:: bash
13+
14+
$ composer require behat/mink-browserkit-driver
15+
16+
.. note::
17+
18+
The BrowserKit component only provides an abstract implementation. The
19+
actual implementation are provided by other projects, like `Goutte`_
20+
or the `Symfony HttpKernel`_ component.
21+
22+
If you are using Goutte, you should use the special :doc:`/drivers/goutte`
23+
which ensures full compatibility for Goutte due to an edge case in Goutte.
24+
25+
Usage
26+
-----
27+
28+
In order to talk with BrowserKit, you should instantiate a
29+
``Behat\Mink\Driver\BrowserKitDriver``:
30+
31+
.. code-block:: php
32+
33+
$browserkitClient = // ...
34+
35+
$driver = new \Behat\Mink\Driver\BrowserKitDriver($browserkitClient);
36+
37+
.. _Goutte: https://github.com/FriendsOfPHP/Goutte
38+
.. _Symfony BrowserKit: http://symfony.com/components/BrowserKit
39+
.. _Symfony HttpKernel: http://symfony.com/components/HttpKernel
40+
.. _Symfony project: http://symfony.com

drivers/goutte.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ GoutteDriver provides a bridge for the `Goutte`_ headless browser. Goutte
55
is a classical pure-php headless browser, written by the creator of the Symfony
66
framework Fabien Potencier.
77

8+
.. note::
9+
10+
The GoutteDriver extends the :doc:`/drivers/browserkit` to fix a small
11+
edge case in the Goutte implementation of BrowserKit. It is also able
12+
to instantiate the Goutte client automatically.
13+
814
Installation
915
------------
1016

guides/drivers.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ Mink always talks with browser emulators through its driver. It doesn't know
99
anything about how to start/stop or traverse page in that particular browser
1010
emulator. It only knows what driver method it should call in order to do this.
1111

12-
Mink comes with five drivers out of the box:
12+
Mink comes with six drivers out of the box:
1313

1414
.. toctree::
1515
:maxdepth: 1
1616

1717
/drivers/goutte
18+
/drivers/browserkit
1819
/drivers/selenium2
1920
/drivers/zombie
2021
/drivers/sahi

0 commit comments

Comments
 (0)