AssertsStatusCodes
trait AssertsStatusCodes (View source)
Methods
$this | assertOk()
Assert that the response has a 200 "OK" status code. | |
$this | assertCreated()
Assert that the response has a 201 "Created" status code. | |
$this | assertAccepted()
Assert that the response has a 202 "Accepted" status code. | |
$this | assertNoContent(int $status = 204)
Assert that the response has the given status code and no content. | |
$this | assertMovedPermanently()
Assert that the response has a 301 "Moved Permanently" status code. | |
$this | assertFound()
Assert that the response has a 302 "Found" status code. | |
$this | assertBadRequest()
Assert that the response has a 400 "Bad Request" status code. | |
$this | assertUnauthorized()
Assert that the response has a 401 "Unauthorized" status code. | |
$this | assertPaymentRequired()
Assert that the response has a 402 "Payment Required" status code. | |
$this | assertForbidden()
Assert that the response has a 403 "Forbidden" status code. | |
$this | assertNotFound()
Assert that the response has a 404 "Not Found" status code. | |
$this | assertRequestTimeout()
Assert that the response has a 408 "Request Timeout" status code. | |
$this | assertConflict()
Assert that the response has a 409 "Conflict" status code. | |
$this | assertUnprocessable()
Assert that the response has a 422 "Unprocessable Entity" status code. | |
$this | assertTooManyRequests()
Assert that the response has a 429 "Too Many Requests" status code. |
Details
$this assertOk()
Assert that the response has a 200 "OK" status code.
$this assertCreated()
Assert that the response has a 201 "Created" status code.
$this assertAccepted()
Assert that the response has a 202 "Accepted" status code.
$this assertNoContent(int $status = 204)
Assert that the response has the given status code and no content.
$this assertMovedPermanently()
Assert that the response has a 301 "Moved Permanently" status code.
$this assertFound()
Assert that the response has a 302 "Found" status code.
$this assertBadRequest()
Assert that the response has a 400 "Bad Request" status code.
$this assertUnauthorized()
Assert that the response has a 401 "Unauthorized" status code.
$this assertPaymentRequired()
Assert that the response has a 402 "Payment Required" status code.
$this assertForbidden()
Assert that the response has a 403 "Forbidden" status code.
$this assertNotFound()
Assert that the response has a 404 "Not Found" status code.
$this assertRequestTimeout()
Assert that the response has a 408 "Request Timeout" status code.
$this assertConflict()
Assert that the response has a 409 "Conflict" status code.
$this assertUnprocessable()
Assert that the response has a 422 "Unprocessable Entity" status code.
$this assertTooManyRequests()
Assert that the response has a 429 "Too Many Requests" status code.
© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/9.x/Illuminate/Testing/Concerns/AssertsStatusCodes.html