We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent33dbf1a commite8e5235Copy full SHA for e8e5235
UPGRADE-4.3.md
@@ -1,6 +1,11 @@
1
UPGRADE FROM 4.2 to 4.3
2
=======================
3
4
+BrowserKit
5
+----------
6
+
7
+* Deprecated`Response::getStatus()`, use`Response::getStatusCode()` instead
8
9
Config
10
------
11
UPGRADE-5.0.md
@@ -4,6 +4,7 @@ UPGRADE FROM 4.x to 5.0
BrowserKit
----------
+* Removed`Response::getStatus()`, use`Response::getStatusCode()` instead
* The`Client::submit()` method has a new`$serverParameters` argument.
Cache
src/Symfony/Component/BrowserKit/CHANGELOG.md
CHANGELOG
=========
+4.3.0
+-----
4.2.0
-----
src/Symfony/Component/BrowserKit/Client.php
@@ -409,7 +409,7 @@ public function request(string $method, string $uri, array $parameters = array()
409
410
$this->cookieJar->updateFromResponse($this->internalResponse,$uri);
411
412
-$status =$this->internalResponse->getStatus();
+$status =$this->internalResponse->getStatusCode();
413
414
if ($status >=300 &&$status <400) {
415
$this->redirect =$this->internalResponse->getHeader('Location');
@@ -599,7 +599,7 @@ public function followRedirect()
599
600
$request =$this->internalRequest;
601
602
-if (\in_array($this->internalResponse->getStatus(),array(301,302,303))) {
+if (\in_array($this->internalResponse->getStatusCode(),array(301,302,303))) {
603
$method ='GET';
604
$files =array();
605
$content =null;
src/Symfony/Component/BrowserKit/Response.php
@@ -83,8 +83,17 @@ public function getContent()
83
* Gets the response status code.
84
*
85
* @return int The response status code
86
+ *
87
+ * @deprecated since Symfony 4.3, use getStatusCode() instead
88
*/
89
publicfunctiongetStatus()
90
+ {
91
+ @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.3, use getStatusCode() instead.',__METHOD__),E_USER_DEPRECATED);
92
93
+return$this->status;
94
+ }
95
96
+publicfunctiongetStatusCode():int
97
{
98
return$this->status;
99
}
src/Symfony/Component/BrowserKit/Tests/ClientTest.php
@@ -52,7 +52,7 @@ protected function doRequest($request)
52
protectedfunctionfilterResponse($response)
53
54
if ($responseinstanceof SpecialResponse) {
55
-returnnewResponse($response->getContent(),$response->getStatus(),$response->getHeaders());
+returnnewResponse($response->getContent(),$response->getStatusCode(),$response->getHeaders());
56
57
58
return$response;
src/Symfony/Component/BrowserKit/Tests/ResponseTest.php
@@ -22,12 +22,21 @@ public function testGetUri()
22
$this->assertEquals('foo',$response->getContent(),'->getContent() returns the content of the response');
23
24
25
+/**
26
+ * @group legacy
27
+ */
28
publicfunctiontestGetStatus()
29
30
$response =newResponse('foo',304);
31
$this->assertEquals('304',$response->getStatus(),'->getStatus() returns the status of the response');
32
33
34
+publicfunctiontestGetStatusCode()
35
36
+$response =newResponse('foo',304);
37
+$this->assertEquals('304',$response->getStatusCode(),'->getStatusCode() returns the status of the response');
38
39
40
publicfunctiontestGetHeaders()
41
42
$response =newResponse('foo',200,array('foo' =>'bar'));