Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf8a09db

Browse files
committed
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: yesFeature addition: noBackwards compatibility break: yes/no, choice is yourSymfony2 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:00ZThis *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:54ZThis pull request [passes](http://travis-ci.org/symfony/symfony/builds/1533533) (merged686854b into1541fe2).---------------------------------------------------------------------------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:43ZThis pull request [passes](http://travis-ci.org/symfony/symfony/builds/1575524) (merged06976fc into1541fe2).---------------------------------------------------------------------------by stof at 2012-06-09T12:50:16Z@fabpot 👍
2 parentsae2ec36 +06976fc commitf8a09db

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

‎UPGRADE-2.1.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,14 @@
10281028
decoded twice before. Note that the `urldecode()` calls have been changed for a
10291029
single `rawurldecode()` in order to support `+` for input paths.
10301030
1031+
### BrowserKit
1032+
1033+
#### BC Breaks
1034+
1035+
* The Symfony\Component\HttpKernel\Client::request() method
1036+
now returns a Symfony\Component\BrowserKit\Response instance
1037+
(instead of a Symfony\Component\HttpFoundation\Response instance)
1038+
10311039
### FrameworkBundle
10321040
10331041
* session options: lifetime, path, domain, secure, httponly were deprecated.

‎src/Symfony/Component/BrowserKit/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@ CHANGELOG
44
2.1.0
55
-----
66

7+
*[BR BREAK] The Symfony\Component\HttpKernel\Client::request() method
8+
now returns a Symfony\Component\BrowserKit\Response instance
9+
(instead of a Symfony\Component\HttpFoundation\Response instance)
10+
711
*[BC BREAK] The CookieJar internals have changed to allow cookies with the
812
same name on different sub-domains/sub-paths

‎src/Symfony/Component/BrowserKit/Client.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,17 +264,17 @@ public function request($method, $uri, array $parameters = array(), array $files
264264
$this->response =$this->doRequest($this->request);
265265
}
266266

267-
$response =$this->filterResponse($this->response);
267+
$this->response =$this->filterResponse($this->response);
268268

269-
$this->cookieJar->updateFromResponse($response);
269+
$this->cookieJar->updateFromResponse($this->response);
270270

271-
$this->redirect =$response->getHeader('Location');
271+
$this->redirect =$this->response->getHeader('Location');
272272

273273
if ($this->followRedirects &&$this->redirect) {
274274
return$this->crawler =$this->followRedirect();
275275
}
276276

277-
return$this->crawler =$this->createCrawlerFromContent($request->getUri(),$response->getContent(),$response->getHeader('Content-Type'));
277+
return$this->crawler =$this->createCrawlerFromContent($request->getUri(),$this->response->getContent(),$this->response->getHeader('Content-Type'));
278278
}
279279

280280
/**

‎src/Symfony/Component/HttpKernel/Tests/ClientTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespaceSymfony\Component\HttpKernel\Tests;
1313

14+
useSymfony\Component\BrowserKit\ResponseasDomResponse;
1415
useSymfony\Component\HttpKernel\Client;
1516
useSymfony\Component\HttpKernel\HttpKernel;
1617
useSymfony\Component\HttpFoundation\Request;
@@ -34,6 +35,7 @@ public function testDoRequest()
3435

3536
$client->request('GET','/');
3637
$this->assertEquals('Request: /',$client->getResponse()->getContent(),'->doRequest() uses the request handler to make the request');
38+
$this->assertTrue($client->getResponse()instanceof DomResponse,'->getResponse() returns a Symfony\Component\BrowserKit\Response instance');
3739

3840
$client->request('GET','http://www.example.com/');
3941
$this->assertEquals('Request: /',$client->getResponse()->getContent(),'->doRequest() uses the request handler to make the request');

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp