Skip to content

Client's history clear alternative #8704

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

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
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
12 changes: 12 additions & 0 deletions components/browser_kit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,18 @@ also delete all the cookies::
// delete history
$client->restart();

You can also delete the client's history with the ``clear()`` method of client's ``History`` attribute::

use Acme\Client;

// make a real request to an external site
$client = new Client();
$client->request('GET', 'http://symfony.com');

//delete history
$client->getHistory()
->clear();

Learn more
----------

Expand Down