PHP 클래스 RESTContext, imbo

상속: implements Behat\Behat\Context\Context
파일 보기 프로젝트 열기: imbo/imbo 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$client Guzzle\Http\Client Guzzle client used to make requests against the httpd
$queryParams array Query parameters for the request
$requestBody string Optional request body to add to the request
$requestHeaders array Headers for the request
$responses Guzzle\Http\Message\Response[] The current response objects used by the client (populated when the request is sent)

공개 메소드들

메소드 설명
__construct ( array $parameters ) Class constructor
appendQueryStringParameter ( $queryParam, $value )
assertEmptyResponseBody ( )
assertEqualResponseHeaders ( Behat\Gherkin\Node\PyStringNode $list )
assertExistingHeaders ( Behat\Gherkin\Node\PyStringNode $list )
assertHeaderDoesNotExist ( $header )
assertHeaderNotSameForPreviousRequests ( $header )
assertMaxAge ( $seconds )
assertMissingHeaders ( Behat\Gherkin\Node\PyStringNode $list )
assertMustRevalidate ( $doesNotHave = false )
assertResponseBody ( $match, Behat\Gherkin\Node\PyStringNode $expected )
assertResponseBodyLength ( $length )
assertResponseHeader ( $header, $match, $value )
assertResponseIsCacheable ( $cacheable = true )
assertResponseStatus ( $status )
attachFileToRequestBody ( $path )
makeSameRequest ( $method )
performRequestWithGivenQueryString ( $path )
request ( $path, $method = 'GET' )
setOverrideMethodHeader ( string $method ) Set method override header used to fake non-standard HTTP verbs
setRequestBody ( Behat\Gherkin\Node\PyStringNode $body )
setRequestHeader ( $header, $value )
setUp ( Behat\Behat\Event\SuiteEvent $event ) Start up the built in httpd in php-5.4
tearDown ( Behat\Behat\Event\SuiteEvent $event ) Collect code coverage after the suite has been run

보호된 메소드들

메소드 설명
addHeaderToNextRequest ( string $key, mixed $value ) Add a request header for the next request
getLastResponse ( ) : Guzzle\Http\Message\Response Get the response to the last request made by the Guzzle client
getPreviousCacheControlHeader ( ) : Guzzle\Http\Message\Header\CacheControl Get the cache-control header for the previous response

비공개 메소드들

메소드 설명
canConnectToHttpd ( string $host, integer $port ) : boolean See if we have an httpd we can connect to
createClient ( ) Create a new HTTP client
getOverrideVerbs ( ) Returns a list of HTTP verbs that we need to do an override of in order to bypass limitations in the built-in PHP HTTP server.
startBuiltInHttpd ( string $host, integer $port, string $documentRoot, string $router, string $httpdLog ) : integer Start the built in httpd in php-5.4

메소드 상세

__construct() 공개 메소드

Class constructor
public __construct ( array $parameters )
$parameters array Context parameters

addHeaderToNextRequest() 보호된 메소드

Add a request header for the next request
protected addHeaderToNextRequest ( string $key, mixed $value )
$key string The name of the header
$value mixed The value of the header

appendQueryStringParameter() 공개 메소드

public appendQueryStringParameter ( $queryParam, $value )

assertEmptyResponseBody() 공개 메소드

assertEqualResponseHeaders() 공개 메소드

public assertEqualResponseHeaders ( Behat\Gherkin\Node\PyStringNode $list )
$list Behat\Gherkin\Node\PyStringNode

assertExistingHeaders() 공개 메소드

public assertExistingHeaders ( Behat\Gherkin\Node\PyStringNode $list )
$list Behat\Gherkin\Node\PyStringNode

assertHeaderDoesNotExist() 공개 메소드

public assertHeaderDoesNotExist ( $header )

assertHeaderNotSameForPreviousRequests() 공개 메소드

assertMaxAge() 공개 메소드

public assertMaxAge ( $seconds )

assertMissingHeaders() 공개 메소드

public assertMissingHeaders ( Behat\Gherkin\Node\PyStringNode $list )
$list Behat\Gherkin\Node\PyStringNode

assertMustRevalidate() 공개 메소드

public assertMustRevalidate ( $doesNotHave = false )

assertResponseBody() 공개 메소드

public assertResponseBody ( $match, Behat\Gherkin\Node\PyStringNode $expected )
$expected Behat\Gherkin\Node\PyStringNode

assertResponseBodyLength() 공개 메소드

public assertResponseBodyLength ( $length )

assertResponseHeader() 공개 메소드

public assertResponseHeader ( $header, $match, $value )

assertResponseIsCacheable() 공개 메소드

public assertResponseIsCacheable ( $cacheable = true )

assertResponseStatus() 공개 메소드

public assertResponseStatus ( $status )

attachFileToRequestBody() 공개 메소드

public attachFileToRequestBody ( $path )

getLastResponse() 보호된 메소드

Get the response to the last request made by the Guzzle client
protected getLastResponse ( ) : Guzzle\Http\Message\Response
리턴 Guzzle\Http\Message\Response

getPreviousCacheControlHeader() 보호된 메소드

Get the cache-control header for the previous response
protected getPreviousCacheControlHeader ( ) : Guzzle\Http\Message\Header\CacheControl
리턴 Guzzle\Http\Message\Header\CacheControl The Cache-Control header for the previous response

makeSameRequest() 공개 메소드

public makeSameRequest ( $method )

performRequestWithGivenQueryString() 공개 메소드

request() 공개 메소드

public request ( $path, $method = 'GET' )

setOverrideMethodHeader() 공개 메소드

Set method override header used to fake non-standard HTTP verbs
public setOverrideMethodHeader ( string $method )
$method string Override method

setRequestBody() 공개 메소드

public setRequestBody ( Behat\Gherkin\Node\PyStringNode $body )
$body Behat\Gherkin\Node\PyStringNode

setRequestHeader() 공개 메소드

public setRequestHeader ( $header, $value )

setUp() 공개 정적인 메소드

Start up the built in httpd in php-5.4
public static setUp ( Behat\Behat\Event\SuiteEvent $event )
$event Behat\Behat\Event\SuiteEvent

tearDown() 공개 정적인 메소드

Collect code coverage after the suite has been run
public static tearDown ( Behat\Behat\Event\SuiteEvent $event )
$event Behat\Behat\Event\SuiteEvent

프로퍼티 상세

$client 보호되어 있는 프로퍼티

Guzzle client used to make requests against the httpd
protected Client,Guzzle\Http $client
리턴 Guzzle\Http\Client

$queryParams 보호되어 있는 프로퍼티

Query parameters for the request
protected array $queryParams
리턴 array

$requestBody 보호되어 있는 프로퍼티

Optional request body to add to the request
protected string $requestBody
리턴 string

$requestHeaders 보호되어 있는 프로퍼티

Headers for the request
protected array $requestHeaders
리턴 array

$responses 보호되어 있는 프로퍼티

The current response objects used by the client (populated when the request is sent)
protected Response[],Guzzle\Http\Message $responses
리턴 Guzzle\Http\Message\Response[]