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.
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.
© 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