PHP Class Sanpi\Behatch\Context\RestContext

Inheritance: extends BaseContext
Exibir arquivo Open project: behatch/contexts Class Usage Examples

Protected Properties

Property Type Description
$request

Public Methods

Method Description
__construct ( Request $request )
iAddHeaderEqualTo ( $name, $value ) Add an header element in a request
iSendARequestTo ( $method, $url, Behat\Gherkin\Node\PyStringNode $body = null, $files = [] ) Sends a HTTP request
iSendARequestToWithBody ( $method, $url, Behat\Gherkin\Node\PyStringNode $body ) Sends a HTTP request with a body
iSendARequestToWithParameters ( $method, $url, Behat\Gherkin\Node\TableNode $datas ) Sends a HTTP request with a some parameters
printLastResponseHeaders ( )
printTheCorrespondingCurlCommand ( )
theHeaderShouldBeContains ( $name, $value ) Checks, whether the header name contains the given text
theHeaderShouldBeEqualTo ( $name, $value ) Checks, whether the header name is equal to given text
theHeaderShouldNotContain ( $name, $value ) Checks, whether the header name doesn't contain the given text
theHeaderShouldNotExist ( $name ) Checks, whether the header not exist
theResponseShouldBeEmpty ( ) Checks, whether the response content is null or empty string
theResponseShouldBeEncodedIn ( $encoding )
theResponseShouldBeEqualTo ( Behat\Gherkin\Node\PyStringNode $expected ) Checks, whether the response content is equal to given text
theResponseShouldExpireInTheFuture ( ) Checks, that the response header expire is in the future

Protected Methods

Method Description
theHeaderShouldExist ( $name )

Method Details

__construct() public method

public __construct ( Request $request )
$request Sanpi\Behatch\HttpCall\Request

iAddHeaderEqualTo() public method

Add an header element in a request
public iAddHeaderEqualTo ( $name, $value )

iSendARequestTo() public method

Sends a HTTP request
public iSendARequestTo ( $method, $url, Behat\Gherkin\Node\PyStringNode $body = null, $files = [] )
$body Behat\Gherkin\Node\PyStringNode

iSendARequestToWithBody() public method

Sends a HTTP request with a body
public iSendARequestToWithBody ( $method, $url, Behat\Gherkin\Node\PyStringNode $body )
$body Behat\Gherkin\Node\PyStringNode

iSendARequestToWithParameters() public method

Sends a HTTP request with a some parameters
public iSendARequestToWithParameters ( $method, $url, Behat\Gherkin\Node\TableNode $datas )
$datas Behat\Gherkin\Node\TableNode

printLastResponseHeaders() public method

printTheCorrespondingCurlCommand() public method

theHeaderShouldBeContains() public method

Checks, whether the header name contains the given text
public theHeaderShouldBeContains ( $name, $value )

theHeaderShouldBeEqualTo() public method

Checks, whether the header name is equal to given text
public theHeaderShouldBeEqualTo ( $name, $value )

theHeaderShouldExist() protected method

protected theHeaderShouldExist ( $name )

theHeaderShouldNotContain() public method

Checks, whether the header name doesn't contain the given text
public theHeaderShouldNotContain ( $name, $value )

theHeaderShouldNotExist() public method

Checks, whether the header not exist
public theHeaderShouldNotExist ( $name )

theResponseShouldBeEmpty() public method

Checks, whether the response content is null or empty string

theResponseShouldBeEncodedIn() public method

public theResponseShouldBeEncodedIn ( $encoding )

theResponseShouldBeEqualTo() public method

Checks, whether the response content is equal to given text
public theResponseShouldBeEqualTo ( Behat\Gherkin\Node\PyStringNode $expected )
$expected Behat\Gherkin\Node\PyStringNode

theResponseShouldExpireInTheFuture() public method

Checks, that the response header expire is in the future

Property Details

$request protected_oe property

protected $request