class Response (View source)

Methods

__construct(Parser $parser)

Behovior constructor.

assertJson(string $message = '')

Check if the content is json format

assertExactJson(array $data, string $message = '')

Check if the content is json format and the parsed data is some to the content

assertContainsExactText(string $data, string $message = '')

Check if the content is some of parse data

assertHeader(string $header, string $message = '')

Check if the header exists

assertArray(string $message = '')

Check if the content is array format

assertContentType(string $content_type, string $message = '')

Check the content type

assertContentTypeJson(string $message = '')

Check if the content type is application/json

assertContentTypeText(string $message = '')

Check if the content type is text/plain

assertContentTypeHtml(string $message = '')

Check if the content type is text/html

assertContentTypeXml(string $message = '')

Check if the content type is text/xml

assertStatus(int $code, string $message = '')

Check the status code

assertKeyExists(string $key, string $message = '')

No description

assertKeyMatchValue(string|int $key, mixed $value, string $message = '')

No description

assertContains(string $text)

Check if the content contains the parsed text

string
getContent()

Get the response content

mixed
__call(string $method, array $params = [])

__call

Details

__construct(Parser $parser)

Behovior constructor.

Parameters

Parser $parser

Response assertJson(string $message = '')

Check if the content is json format

Parameters

string $message

Return Value

Response

Response assertExactJson(array $data, string $message = '')

Check if the content is json format and the parsed data is some to the content

Parameters

array $data
string $message

Return Value

Response

Response assertContainsExactText(string $data, string $message = '')

Check if the content is some of parse data

Parameters

string $data
string $message

Return Value

Response

Response assertHeader(string $header, string $message = '')

Check if the header exists

Parameters

string $header
string $message

Return Value

Response

Response assertArray(string $message = '')

Check if the content is array format

Parameters

string $message

Return Value

Response

Response assertContentType(string $content_type, string $message = '')

Check the content type

Parameters

string $content_type
string $message

Return Value

Response

Response assertContentTypeJson(string $message = '')

Check if the content type is application/json

Parameters

string $message

Return Value

Response

Response assertContentTypeText(string $message = '')

Check if the content type is text/plain

Parameters

string $message

Return Value

Response

Response assertContentTypeHtml(string $message = '')

Check if the content type is text/html

Parameters

string $message

Return Value

Response

Response assertContentTypeXml(string $message = '')

Check if the content type is text/xml

Parameters

string $message

Return Value

Response

Response assertStatus(int $code, string $message = '')

Check the status code

Parameters

int $code
string $message

Return Value

Response

Response assertKeyExists(string $key, string $message = '')

No description

Parameters

string $key
string $message

Return Value

Response

Response assertKeyMatchValue(string|int $key, mixed $value, string $message = '')

No description

Parameters

string|int $key
mixed $value
string $message

Return Value

Response

Response assertContains(string $text)

Check if the content contains the parsed text

Parameters

string $text

Return Value

Response

string getContent()

Get the response content

Return Value

string

mixed __call(string $method, array $params = [])

__call

Parameters

string $method
array $params

Return Value

mixed