Class

eZ\Bundle\EzPublishRestBundle\Features\Context\RestContext

class RestContext extends Context implements MinkAwareContext

RestContext is the core of the REST testing All SubContext (traits), helpers are loaded here Settings and client initializations is done here Also it contains all REST generic actions.

Constants

AUTHTYPE_BASICHTTP

AUTHTYPE_SESSION

DEFAULT_URL

DEFAULT_DRIVER

DEFAULT_BODY_TYPE

DEFAULT_AUTH_TYPE

Methods

__construct($driver = self::DEFAULT_DRIVER, $type = self::DEFAULT_BODY_TYPE, $authType = self::DEFAULT_AUTH_TYPE)

Initialize class.

setMink(Mink $mink)

Sets Mink instance.

setMinkParameters(array $parameters)

Sets parameters provided for Mink.

createRequest($type, $resource)

createAndSendRequest($type, $resource)

setHeader($header, $value)

setHeaders(TableNode $table)

sendRequest()

assertStatusCode($code)

assertStatusMessage($message)

existResponseHeader($header)

dontExistResponseHeader($header)

assertHeaderHaveValue($header, $value)

assertHeaderDontHaveValue($header, $value)

responseBodyHasValue($value)

Details

at line 79
public __construct($driver = self::DEFAULT_DRIVER, $type = self::DEFAULT_BODY_TYPE, $authType = self::DEFAULT_AUTH_TYPE)

Initialize class.

Parameters

$driver
$type
$authType

at line 104
public setMink(Mink $mink)

Sets Mink instance.

Parameters

Mink $mink Mink session manager

at line 115
public setMinkParameters(array $parameters)

Sets parameters provided for Mink.

While at it, take the base_url, and use it to build the one for the REST driver.

Parameters

array $parameters

at line 158
public createRequest($type, $resource)

Parameters

$type
$resource

at line 170
public createAndSendRequest($type, $resource)

Parameters

$type
$resource

at line 179
public setHeader($header, $value)

Parameters

$header
$value

at line 187
public setHeaders(TableNode $table)

Parameters

TableNode $table

at line 199
public sendRequest()

at line 214
public assertStatusCode($code)

Parameters

$code

at line 262
public assertStatusMessage($message)

Parameters

$message

at line 274
public existResponseHeader($header)

Parameters

$header

at line 285
public dontExistResponseHeader($header)

Parameters

$header

at line 296
public assertHeaderHaveValue($header, $value)

Parameters

$header
$value

at line 308
public assertHeaderDontHaveValue($header, $value)

Parameters

$header
$value

at line 320
public responseBodyHasValue($value)

Parameters

$value