Symfony\Component\BrowserKit\Client::restart PHP Method

restart() public method

It flushes history and all cookies.
public restart ( )
    public function restart()
    {
        $this->cookieJar->clear();
        $this->history->clear();
    }

Usage Example

 protected function login(Client $client, $username = '******', $password = '******')
 {
     $client->restart();
     $crawler = $client->request('GET', '/login');
     $this->assertTrue($client->getResponse()->isSuccessful(), 'Response should be successful');
     $form = $crawler->selectButton('Login')->form();
     $client->submit($form, array('_username' => $username, '_password' => $password));
     $this->assertTrue($client->getResponse()->isRedirect(), 'Response should be redirect');
     $crawler = $client->followRedirect();
     $this->assertGreaterThan(0, $crawler->filter('html:contains("Benvenuto")')->count());
 }
All Usage Examples Of Symfony\Component\BrowserKit\Client::restart