Skip to content

updated documentation for BrowserKit #2549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 30, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions book/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ The Client supports many operations that can be done in a real browser::
Accessing Internal Objects
~~~~~~~~~~~~~~~~~~~~~~~~~~

.. versionadded:: 2.3
The ``getInternalRequest()`` and ``getInternalResponse()`` method were
added in Symfony 2.3.

If you use the client to test your application, you might want to access the
client's internal objects::

Expand All @@ -409,8 +413,18 @@ client's internal objects::

You can also get the objects related to the latest request::

// the HttpKernel request instance
$request = $client->getRequest();

// the BrowserKit request instance
$request = $client->getInternalRequest();

// the HttpKernel response instance
$response = $client->getResponse();

// the BrowserKit response instance
$response = $client->getInternalResponse();

$crawler = $client->getCrawler();

If your requests are not insulated, you can also access the ``Container`` and
Expand Down