Метод |
Описание |
|
respondMethodShouldAllowSettingHeaders ( ) |
Test that you can set any headers to the JSON response by passing a second argument
to the [respond] method. |
|
respondMethodShouldAllowSettingStatusCode ( ) |
Test that the [respond] method allows passing a status code as the first parameter. |
|
respondMethodShouldReturnAJsonResponse ( ) |
Test that the [respond] method converts the error response into an instance of
[\Illuminate\Http\JsonResponse] with a default status code of 500. |
|
setErrorMethodShouldAddErrorData ( ) |
Test that error data is added when an error code is set using the [setError] method. |
|
setErrorMethodShouldAllowAddingParametersToMessage ( ) |
Test that the [setError] method should allow passing any parameters to the translator
when resolving the error message. |
|
setErrorMethodShouldAllowOverridingErrorMessage ( ) |
Test that the [setError] method allows passing a string as second argument instead of an
array of parameters, which will override the error message and set it explicitly. |
|
setErrorMethodShouldResolveErrorMessageFromTranslator ( ) |
Test that the [setError] method attempts to resolve an error message from the translator. |
|
setStatusMethodShouldFailIfStatusCodeIsInvalid ( ) |
Test that the [setStatus] method throws an [\InvalidArgumentException] when the status
code given is not a valid error HTTP status code. |
|
setStatusMethodShouldReturnItself ( ) |
Test that the [setStatus] method returns the response builder, allowing for fluent
method chaining. |
|
setStatusMethodShouldSetStatusCode ( ) |
Test that the [setStatus] method sets the HTTP status code on the response, providing
an alternative, more explicit way of setting the status code. |
|
toArrayMethodShouldSerializeData ( ) |
Test that the [toArray] method serializes the data given, using the default serializer
and no data. |
|
toCollectionMethodShouldReturnACollection ( ) |
Test that the [toCollection] serializes the data into a collection. |
|
toJsonMethodShouldReturnJson ( ) |
Test that the [toJson] serializes the data into a JSON string. |
|
youCanResolveASuccessResponseBuilderFromTheContainer ( ) |
Test that you can resolve an instance of [\Flugg\Responder\ErrorResponseBuilder]
from the service container. |
|