MakesHttpRequests (Foundation\Testing)

MakesHttpRequests

trait MakesHttpRequests (View source)

Methods

$this withoutMiddleware()

Disable middleware for the test.

TestResponse get(string $uri, array $headers = array())

Visit the given URI with a GET request.

TestResponse getJson(string $uri, array $headers = array())

Visit the given URI with a GET request, expecting a JSON response.

TestResponse post(string $uri, array $data = array(), array $headers = array())

Visit the given URI with a POST request.

TestResponse postJson(string $uri, array $data = array(), array $headers = array())

Visit the given URI with a POST request, expecting a JSON response.

TestResponse put(string $uri, array $data = array(), array $headers = array())

Visit the given URI with a PUT request.

TestResponse putJson(string $uri, array $data = array(), array $headers = array())

Visit the given URI with a PUT request, expecting a JSON response.

TestResponse patch(string $uri, array $data = array(), array $headers = array())

Visit the given URI with a PATCH request.

TestResponse patchJson(string $uri, array $data = array(), array $headers = array())

Visit the given URI with a PATCH request, expecting a JSON response.

TestResponse delete(string $uri, array $data = array(), array $headers = array())

Visit the given URI with a DELETE request.

TestResponse deleteJson(string $uri, array $data = array(), array $headers = array())

Visit the given URI with a DELETE request, expecting a JSON response.

TestResponse json(string $method, string $uri, array $data = array(), array $headers = array())

Call the given URI with a JSON request.

TestResponse call(string $method, string $uri, array $parameters = array(), array $cookies = array(), array $files = array(), array $server = array(), string $content = null)

Call the given URI and return the Response.

Details

$this withoutMiddleware()

Disable middleware for the test.

Return Value

$this

TestResponse get(string $uri, array $headers = array())

Visit the given URI with a GET request.

Parameters

string $uri
array $headers

Return Value

TestResponse

TestResponse getJson(string $uri, array $headers = array())

Visit the given URI with a GET request, expecting a JSON response.

Parameters

string $uri
array $headers

Return Value

TestResponse

TestResponse post(string $uri, array $data = array(), array $headers = array())

Visit the given URI with a POST request.

Parameters

string $uri
array $data
array $headers

Return Value

TestResponse

TestResponse postJson(string $uri, array $data = array(), array $headers = array())

Visit the given URI with a POST request, expecting a JSON response.

Parameters

string $uri
array $data
array $headers

Return Value

TestResponse

TestResponse put(string $uri, array $data = array(), array $headers = array())

Visit the given URI with a PUT request.

Parameters

string $uri
array $data
array $headers

Return Value

TestResponse

TestResponse putJson(string $uri, array $data = array(), array $headers = array())

Visit the given URI with a PUT request, expecting a JSON response.

Parameters

string $uri
array $data
array $headers

Return Value

TestResponse

TestResponse patch(string $uri, array $data = array(), array $headers = array())

Visit the given URI with a PATCH request.

Parameters

string $uri
array $data
array $headers

Return Value

TestResponse

TestResponse patchJson(string $uri, array $data = array(), array $headers = array())

Visit the given URI with a PATCH request, expecting a JSON response.

Parameters

string $uri
array $data
array $headers

Return Value

TestResponse

TestResponse delete(string $uri, array $data = array(), array $headers = array())

Visit the given URI with a DELETE request.

Parameters

string $uri
array $data
array $headers

Return Value

TestResponse

TestResponse deleteJson(string $uri, array $data = array(), array $headers = array())

Visit the given URI with a DELETE request, expecting a JSON response.

Parameters

string $uri
array $data
array $headers

Return Value

TestResponse

TestResponse json(string $method, string $uri, array $data = array(), array $headers = array())

Call the given URI with a JSON request.

Parameters

string $method
string $uri
array $data
array $headers

Return Value

TestResponse

TestResponse call(string $method, string $uri, array $parameters = array(), array $cookies = array(), array $files = array(), array $server = array(), string $content = null)

Call the given URI and return the Response.

Parameters

string $method
string $uri
array $parameters
array $cookies
array $files
array $server
string $content

Return Value

TestResponse

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.4/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部