merged branch jfsimon/issue-4475 (PR #4497)
Commits -------06976fc
Updated upgrade 2.1 file.110ccd8
[BrowserKit] Updated changelog.686854b
[http kernel] Added client response type test.ce7e1e6
[browser kit] Client now stores filtered response after request. Discussion ---------- [browser kit] Client now stores filtered response after request. Bug fix: yes Feature addition: no Backwards compatibility break: yes/no, choice is your Symfony2 tests pass: yes `Symfony\Component\HttpKernel\Client::request()` method now returns a `Symfony\Component\BrowserKit\Response` instance. Fixes issue #4475. --------------------------------------------------------------------------- by stof at 2012-06-05T08:58:00Z This *is* as BC break as it changes the class returned by the method, even if the BC break is a bugfix to respect the epxected behavior :) --------------------------------------------------------------------------- by jfsimon at 2012-06-05T09:05:32Z @stof you're right! --------------------------------------------------------------------------- by travisbot at 2012-06-06T15:29:54Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1533533) (merged686854b2
into1541fe26
). --------------------------------------------------------------------------- by stof at 2012-06-09T10:12:18Z @jfsimon can you add a note in the changelog of the component and in the upgrade file ? --------------------------------------------------------------------------- by jfsimon at 2012-06-09T10:51:00Z @stof done! --------------------------------------------------------------------------- by travisbot at 2012-06-09T11:12:43Z This pull request [passes](http://travis-ci.org/symfony/symfony/builds/1575524) (merged06976fcd
into1541fe26
). --------------------------------------------------------------------------- by stof at 2012-06-09T12:50:16Z @fabpot 👍
This commit is contained in:
commit
f8a09db5e2
|
@ -1028,6 +1028,14 @@
|
|||
decoded twice before. Note that the `urldecode()` calls have been changed for a
|
||||
single `rawurldecode()` in order to support `+` for input paths.
|
||||
|
||||
### BrowserKit
|
||||
|
||||
#### BC Breaks
|
||||
|
||||
* The Symfony\Component\HttpKernel\Client::request() method
|
||||
now returns a Symfony\Component\BrowserKit\Response instance
|
||||
(instead of a Symfony\Component\HttpFoundation\Response instance)
|
||||
|
||||
### FrameworkBundle
|
||||
|
||||
* session options: lifetime, path, domain, secure, httponly were deprecated.
|
||||
|
|
|
@ -4,5 +4,9 @@ CHANGELOG
|
|||
2.1.0
|
||||
-----
|
||||
|
||||
* [BR BREAK] The Symfony\Component\HttpKernel\Client::request() method
|
||||
now returns a Symfony\Component\BrowserKit\Response instance
|
||||
(instead of a Symfony\Component\HttpFoundation\Response instance)
|
||||
|
||||
* [BC BREAK] The CookieJar internals have changed to allow cookies with the
|
||||
same name on different sub-domains/sub-paths
|
||||
|
|
|
@ -264,17 +264,17 @@ abstract class Client
|
|||
$this->response = $this->doRequest($this->request);
|
||||
}
|
||||
|
||||
$response = $this->filterResponse($this->response);
|
||||
$this->response = $this->filterResponse($this->response);
|
||||
|
||||
$this->cookieJar->updateFromResponse($response);
|
||||
$this->cookieJar->updateFromResponse($this->response);
|
||||
|
||||
$this->redirect = $response->getHeader('Location');
|
||||
$this->redirect = $this->response->getHeader('Location');
|
||||
|
||||
if ($this->followRedirects && $this->redirect) {
|
||||
return $this->crawler = $this->followRedirect();
|
||||
}
|
||||
|
||||
return $this->crawler = $this->createCrawlerFromContent($request->getUri(), $response->getContent(), $response->getHeader('Content-Type'));
|
||||
return $this->crawler = $this->createCrawlerFromContent($request->getUri(), $this->response->getContent(), $this->response->getHeader('Content-Type'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
namespace Symfony\Component\HttpKernel\Tests;
|
||||
|
||||
use Symfony\Component\BrowserKit\Response as DomResponse;
|
||||
use Symfony\Component\HttpKernel\Client;
|
||||
use Symfony\Component\HttpKernel\HttpKernel;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
@ -34,6 +35,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
$client->request('GET', '/');
|
||||
$this->assertEquals('Request: /', $client->getResponse()->getContent(), '->doRequest() uses the request handler to make the request');
|
||||
$this->assertTrue($client->getResponse() instanceof DomResponse, '->getResponse() returns a Symfony\Component\BrowserKit\Response instance');
|
||||
|
||||
$client->request('GET', 'http://www.example.com/');
|
||||
$this->assertEquals('Request: /', $client->getResponse()->getContent(), '->doRequest() uses the request handler to make the request');
|
||||
|
|
Reference in New Issue