|
@@ -191,11 +191,12 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
|
|
public function testRequestCookies()
|
|
|
{
|
|
|
$client = new TestClient();
|
|
|
+ $client->setNextResponse(new Response('<html><a href="/foo">foo</a></html>', 200, array(), array('foo' => array('value' => 'bar'))));
|
|
|
$client->request('GET', 'http://www.example.com/foo/foobar');
|
|
|
+ $this->assertEquals(array('foo' => 'bar'), $client->getCookieJar()->getValues('http://www.example.com/foo/foobar'), '->request() updates the CookieJar');
|
|
|
+
|
|
|
$client->request('GET', 'bar');
|
|
|
-RETURN;
|
|
|
- $this->assertEquals('http://www.example.com/foo/bar', $client->getHistory()->current()->getUri(), '->request() updates the History');
|
|
|
- $this->assertEquals('http://www.example.com/foo/foobar', $client->getHistory()->back()->getUri(), '->request() updates the History');
|
|
|
+ $this->assertEquals(array('foo' => 'bar'), $client->getCookieJar()->getValues('http://www.example.com/foo/foobar'), '->request() updates the CookieJar');
|
|
|
}
|
|
|
|
|
|
public function testClick()
|