Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.4] json() method should return the TestResponse object #17341

Merged
merged 1 commit into from
Jan 15, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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