/**
* Make sure we can reset the parameters between consecutive requests
*
*/
public function testResetParameters()
{
$params = array(
'quest' => 'To seek the holy grail',
'YourMother' => 'Was a hamster',
'specialChars' => '<>$+ &?=[]^%',
'array' => array('firstItem', 'secondItem', '3rdItem')
);
$headers = array("X-Foo" => "bar");
$this->client->setParameterPost($params);
$this->client->setParameterGet($params);
$this->client->setHeaders($headers);
$res = $this->client->request('POST');
$this->assertContains(serialize($params) . "\n" . serialize($params),
$res->getBody(), "returned body does not contain all GET and POST parameters (it should!)");
$this->client->resetParameters();
$res = $this->client->request('POST');
$this->assertNotContains(serialize($params), $res->getBody(),
"returned body contains GET or POST parameters (it shouldn't!)");
$this->assertContains($headers["X-Foo"], $this->client->getHeader("X-Foo"), "Header not preserved by reset");
$this->client->resetParameters(true);
$this->assertNull($this->client->getHeader("X-Foo"), "Header preserved by reset(true)");
}