PHP Трейт Flugg\Responder\Traits\MakesApiRequests

Автор: Alexander Tømmerås ([email protected])
Показать файл Открыть проект

Открытые методы

Метод Описание
seeJson ( array $data = null, boolean $negate = false ) Assert that the response contains JSON.
seeJsonEquals ( array $data ) Assert that the response contains an exact JSON array.
seeJsonStructure ( array $structure = null, array | null $responseData = null ) Assert that the JSON response has a given structure.

Защищенные методы

Метод Описание
decodeResponseJson ( ) : array Validate and return the decoded response JSON.
getSuccessData ( string | array | null $attributes = null ) : array Decodes JSON response and returns the data.
seeError ( string $error, integer $status = null ) Assert that the response is a valid error response.
seeJsonSubset ( array $data ) Assert that the response is a superset of the given JSON.
seeStatusCode ( integer $status ) Asserts that the status code of the response matches the given code.
seeSuccess ( mixed $data = null, integer $status = 200 ) Assert that the response is a valid success response.
seeSuccessData ( mixed $data = null ) Assert that the response data contains given values.
seeSuccessEquals ( mixed $data = null, integer $status = 200 ) Assert that the response is a valid success response.
seeSuccessResponse ( mixed $data = null, integer $status = 200 ) : Illuminate\Http\JsonResponse Assert that the response is a valid success response.
seeSuccessStructure ( mixed $data = null ) Assert that the response data contains the given structure.

Описание методов

decodeResponseJson() абстрактный защищенный Метод

Validate and return the decoded response JSON.
abstract protected decodeResponseJson ( ) : array
Результат array

getSuccessData() защищенный Метод

Decodes JSON response and returns the data.
protected getSuccessData ( string | array | null $attributes = null ) : array
$attributes string | array | null
Результат array

seeError() защищенный Метод

Assert that the response is a valid error response.
protected seeError ( string $error, integer $status = null )
$error string
$status integer

seeJson() абстрактный публичный Метод

Assert that the response contains JSON.
abstract public seeJson ( array $data = null, boolean $negate = false )
$data array
$negate boolean

seeJsonEquals() абстрактный публичный Метод

Assert that the response contains an exact JSON array.
abstract public seeJsonEquals ( array $data )
$data array

seeJsonStructure() абстрактный публичный Метод

Assert that the JSON response has a given structure.
abstract public seeJsonStructure ( array $structure = null, array | null $responseData = null )
$structure array
$responseData array | null

seeJsonSubset() абстрактный защищенный Метод

Assert that the response is a superset of the given JSON.
abstract protected seeJsonSubset ( array $data )
$data array

seeStatusCode() абстрактный защищенный Метод

Asserts that the status code of the response matches the given code.
abstract protected seeStatusCode ( integer $status )
$status integer

seeSuccess() защищенный Метод

Assert that the response is a valid success response.
protected seeSuccess ( mixed $data = null, integer $status = 200 )
$data mixed
$status integer

seeSuccessData() защищенный Метод

Assert that the response data contains given values.
protected seeSuccessData ( mixed $data = null )
$data mixed

seeSuccessEquals() защищенный Метод

Assert that the response is a valid success response.
protected seeSuccessEquals ( mixed $data = null, integer $status = 200 )
$data mixed
$status integer

seeSuccessResponse() защищенный Метод

Assert that the response is a valid success response.
protected seeSuccessResponse ( mixed $data = null, integer $status = 200 ) : Illuminate\Http\JsonResponse
$data mixed
$status integer
Результат Illuminate\Http\JsonResponse

seeSuccessStructure() защищенный Метод

Assert that the response data contains the given structure.
protected seeSuccessStructure ( mixed $data = null )
$data mixed