PHP Класс blink\testing\RequestActor

С версии: 0.3.0
Наследование: use trait blink\testing\AuthTrait
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$app
$phpunit
$request blink\http\Request
$response blink\http\Response

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

Метод Описание
__construct ( PHPUnit_Framework_TestCase $phpunit, Application $app )
accepts ( $accepts )
asJson ( ) : mixed Returns the response as json.
delete ( string $uri, array $data = [], array $headers = [] ) Visit the given URI with a DELETE request.
dontSeeJson ( array $data = null ) Assert that the response doesn't contain JSON.
dumpCookies ( ) Dump the response cookies for debug purpose.
dumpHeaders ( ) Dump the response headers for debug purpose.
dumpJson ( ) Dump the response json for debug purpose.
get ( string $uri, array $headers = [] ) Visit the given URI with a GET request.
patch ( string $uri, array $data = [], array $headers = [] ) Visit the given URI with a PATCH request.
post ( string $uri, array $data = [], array $headers = [] ) Visit the given URI with a POST request.
put ( string $uri, array $data = [], array $headers = [] ) Visit the given URI with a PUT request.
seeContent ( string $content ) Asserts that the content of the response matches the given content.
seeCookie ( string $name, mixed $value = null ) Asserts that the response contains the given cookie and equals the optional value.
seeHeader ( string $name, mixed $value = null ) Asserts that the response contains the given header and equals the optional value.
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.
seeStatusCode ( integer $status ) Asserts that the status code of the response matches the given code.
withFiles ( array $files ) Send the request with specified files.
withHeaders ( array $headers = [] )
withJson ( )

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

Метод Описание
doRequest ( $method, $uri, $query = '', $cookies = [], $files = [], $headers = [], $content = null )
formatToExpectedJson ( $key, $value )
isJsonMessage ( blink\http\HeaderBag $headers )
isVerbose ( )
normalizeUri ( $uri )
seeJsonContains ( array $data, boolean $negate = false ) Assert that the response contains the given JSON.

Приватные методы

Метод Описание
isAssoc ( array $array ) : boolean Determines if an array is associative.
sortRecursive ( array $array ) : array Recursively sort an array by keys and values.

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

__construct() публичный Метод

public __construct ( PHPUnit_Framework_TestCase $phpunit, Application $app )
$phpunit PHPUnit_Framework_TestCase
$app blink\core\Application

accepts() публичный Метод

public accepts ( $accepts )

asJson() публичный Метод

Returns the response as json.
public asJson ( ) : mixed
Результат mixed

delete() публичный Метод

Visit the given URI with a DELETE request.
public delete ( string $uri, array $data = [], array $headers = [] )
$uri string
$data array
$headers array

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

protected doRequest ( $method, $uri, $query = '', $cookies = [], $files = [], $headers = [], $content = null )

dontSeeJson() публичный Метод

Assert that the response doesn't contain JSON.
public dontSeeJson ( array $data = null )
$data array

dumpCookies() публичный Метод

Dump the response cookies for debug purpose.
public dumpCookies ( )

dumpHeaders() публичный Метод

Dump the response headers for debug purpose.
public dumpHeaders ( )

dumpJson() публичный Метод

Dump the response json for debug purpose.
public dumpJson ( )

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

protected formatToExpectedJson ( $key, $value )

get() публичный Метод

Visit the given URI with a GET request.
public get ( string $uri, array $headers = [] )
$uri string
$headers array

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

protected isJsonMessage ( blink\http\HeaderBag $headers )
$headers blink\http\HeaderBag

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

protected isVerbose ( )

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

protected normalizeUri ( $uri )

patch() публичный Метод

Visit the given URI with a PATCH request.
public patch ( string $uri, array $data = [], array $headers = [] )
$uri string
$data array
$headers array

post() публичный Метод

Visit the given URI with a POST request.
public post ( string $uri, array $data = [], array $headers = [] )
$uri string
$data array
$headers array

put() публичный Метод

Visit the given URI with a PUT request.
public put ( string $uri, array $data = [], array $headers = [] )
$uri string
$data array
$headers array

seeContent() публичный Метод

Asserts that the content of the response matches the given content.
public seeContent ( string $content )
$content string

seeCookie() публичный Метод

Asserts that the response contains the given cookie and equals the optional value.
public seeCookie ( string $name, mixed $value = null )
$name string
$value mixed

seeHeader() публичный Метод

Asserts that the response contains the given header and equals the optional value.
public seeHeader ( string $name, mixed $value = null )
$name string
$value mixed

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

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

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

Assert that the response contains the given JSON.
protected seeJsonContains ( array $data, boolean $negate = false )
$data array
$negate boolean

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

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

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

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

seeStatusCode() публичный Метод

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

withFiles() публичный Метод

Send the request with specified files.
public withFiles ( array $files )
$files array

withHeaders() публичный Метод

public withHeaders ( array $headers = [] )
$headers array

withJson() публичный Метод

public withJson ( )

Описание свойств

$app защищенное свойство

protected $app

$phpunit защищенное свойство

protected $phpunit

$request защищенное свойство

protected Request,blink\http $request
Результат blink\http\Request

$response защищенное свойство

protected Response,blink\http $response
Результат blink\http\Response