Skip to content

Commit

Permalink
[5.4] json() method should return the TestResponse object (#17341)
Browse files Browse the repository at this point in the history
Return \Illuminate\Foundation\Testing\TestResponse from the json()
method, in order to allow asserting against this object.
Fix the PHPDoc comments for all the methods returning
\Illuminate\Foundation\Testing\TestResponse.
  • Loading branch information
macku99 authored and taylorotwell committed Jan 15, 2017
1 parent c5ac798 commit 3a06b5a
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function withoutMiddleware()
*
* @param string $uri
* @param array $headers
* @return $this
* @return \Illuminate\Foundation\Testing\TestResponse
*/
public function get($uri, array $headers = [])
{
Expand All @@ -62,7 +62,7 @@ public function get($uri, array $headers = [])
*
* @param string $uri
* @param array $headers
* @return $this
* @return \Illuminate\Foundation\Testing\TestResponse
*/
public function getJson($uri, array $headers = [])
{
Expand All @@ -75,7 +75,7 @@ public function getJson($uri, array $headers = [])
* @param string $uri
* @param array $data
* @param array $headers
* @return $this
* @return \Illuminate\Foundation\Testing\TestResponse
*/
public function post($uri, array $data = [], array $headers = [])
{
Expand All @@ -90,7 +90,7 @@ public function post($uri, array $data = [], array $headers = [])
* @param string $uri
* @param array $data
* @param array $headers
* @return $this
* @return \Illuminate\Foundation\Testing\TestResponse
*/
public function postJson($uri, array $data = [], array $headers = [])
{
Expand All @@ -103,7 +103,7 @@ public function postJson($uri, array $data = [], array $headers = [])
* @param string $uri
* @param array $data
* @param array $headers
* @return $this
* @return \Illuminate\Foundation\Testing\TestResponse
*/
public function put($uri, array $data = [], array $headers = [])
{
Expand All @@ -118,7 +118,7 @@ public function put($uri, array $data = [], array $headers = [])
* @param string $uri
* @param array $data
* @param array $headers
* @return $this
* @return \Illuminate\Foundation\Testing\TestResponse
*/
public function putJson($uri, array $data = [], array $headers = [])
{
Expand All @@ -131,7 +131,7 @@ public function putJson($uri, array $data = [], array $headers = [])
* @param string $uri
* @param array $data
* @param array $headers
* @return $this
* @return \Illuminate\Foundation\Testing\TestResponse
*/
public function patch($uri, array $data = [], array $headers = [])
{
Expand All @@ -146,7 +146,7 @@ public function patch($uri, array $data = [], array $headers = [])
* @param string $uri
* @param array $data
* @param array $headers
* @return $this
* @return \Illuminate\Foundation\Testing\TestResponse
*/
public function patchJson($uri, array $data = [], array $headers = [])
{
Expand All @@ -159,7 +159,7 @@ public function patchJson($uri, array $data = [], array $headers = [])
* @param string $uri
* @param array $data
* @param array $headers
* @return $this
* @return \Illuminate\Foundation\Testing\TestResponse
*/
public function delete($uri, array $data = [], array $headers = [])
{
Expand All @@ -174,7 +174,7 @@ public function delete($uri, array $data = [], array $headers = [])
* @param string $uri
* @param array $data
* @param array $headers
* @return $this
* @return \Illuminate\Foundation\Testing\TestResponse
*/
public function deleteJson($uri, array $data = [], array $headers = [])
{
Expand All @@ -188,7 +188,7 @@ public function deleteJson($uri, array $data = [], array $headers = [])
* @param string $uri
* @param array $data
* @param array $headers
* @return $this
* @return \Illuminate\Foundation\Testing\TestResponse
*/
public function json($method, $uri, array $data = [], array $headers = [])
{
Expand All @@ -202,11 +202,9 @@ public function json($method, $uri, array $data = [], array $headers = [])
'Accept' => 'application/json',
], $headers);

$this->call(
return $this->call(
$method, $uri, [], [], $files, $this->transformHeadersToServerVars($headers), $content
);

return $this;
}

/**
Expand All @@ -219,7 +217,7 @@ public function json($method, $uri, array $data = [], array $headers = [])
* @param array $files
* @param array $server
* @param string $content
* @return \Illuminate\Http\Response
* @return \Illuminate\Foundation\Testing\TestResponse
*/
public function call($method, $uri, $parameters = [], $cookies = [], $files = [], $server = [], $content = null)
{
Expand Down

0 comments on commit 3a06b5a

Please sign in to comment.