PHP 클래스 RestContext

상속: extends Behat\Behat\Context\BehatContext
파일 보기 프로젝트 열기: sourcefabric/newscoop 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$access_token string Client access_token
$associative boolean Specifies if the response data should be an associative array or a nested stdClass object hierarchy.
$client Buzz\Browser
$collectedData string Data collected from steps
$headers array Headers
$locations array Locations collected from steps
$requestMethod string
$requestUrl string Used for debugging purpose only.
$response Buzz\Message\Response
$responseData mixed Data decoded from HTTP response.
$responseDecodeException Exception
$responseIsJson boolean

공개 메소드들

메소드 설명
__construct ( array $parameters ) Initializes context.
authenitcatedAsWithClient ( string $username, string $password, string $client, $secret ) : void
authenitcatedWith ( $client, $secret ) : void
checkItemsOrder ( string $order ) : void
collectData ( $dataKey, Behat\Gherkin\Node\TableNode $data ) : void
collectFakeData ( string $dataKey, Behat\Gherkin\Node\TableNode $data ) : boolean
collectHeaders ( $key, $value ) : void
collectLocations ( $locationIndex ) : boolean
echoLastResponse ( ) : void
fieldIsOfTypeWithValue ( string $fieldName, string $type, string $fieldValue ) : void
getResponse ( ) : Guzzle\Http\Message\Response Return the response object.
getResponseData ( ) : mixed Return the response data.
iRequest ( string $pageUrl ) : void
iSubmitDataTo ( $dataKey, string $pageUrl ) : void
processPageUrl ( $pageUrl )
processResponse ( Buzz\Message\Response $response = null, boolean $asJson = true ) : void This public method is also for other context(s) to process REST API call and inject response into this context.
saveFieldValueUnderLocation ( string $fieldName, string $locationIndex ) : Behat\Behat\Context\Step\Then | void
thatIWantToDelete ( ) : void
thatIWantToFind ( ) : void
thatIWantToLink ( ) : void
thatIWantToMakeANew ( ) : void
thatIWantToUnlink ( ) : void
thatIWantToUpdate ( ) : void
theResponseHasAField ( string $name ) : void
theResponseIsJson ( string $notJson = '' ) : void
theResponseShouldBe ( string $string ) : void
theResponseShouldContain ( string $str ) : void
theResponseShouldNotHaveAField ( string $name ) : void
theResponseStatusCodeShouldBe ( integer $httpStatus ) : void
valueOfTheFieldEquals ( string $fieldName, string $fieldValue ) : void

보호된 메소드들

메소드 설명
decodeJson ( string $string ) : mixed Decode JSON string.
processResponseBody ( string $jsonData, boolean $asJson = true ) : void Process response body. This method may also be used by other context(s) to process REST API call and inject response body into this context by using 2nd parameter $asJson.

비공개 메소드들

메소드 설명
extractValueByGivenLocation ( $fieldValue )

메소드 상세

__construct() 공개 메소드

Every scenario gets it's own context object.
public __construct ( array $parameters )
$parameters array Context parameters (set them up through behat.yml)

authenitcatedAsWithClient() 공개 메소드

public authenitcatedAsWithClient ( string $username, string $password, string $client, $secret ) : void
$username string
$password string
$client string
리턴 void

authenitcatedWith() 공개 메소드

public authenitcatedWith ( $client, $secret ) : void
리턴 void

checkItemsOrder() 공개 메소드

public checkItemsOrder ( string $order ) : void
$order string
리턴 void

collectData() 공개 메소드

public collectData ( $dataKey, Behat\Gherkin\Node\TableNode $data ) : void
$data Behat\Gherkin\Node\TableNode
리턴 void

collectFakeData() 공개 메소드

public collectFakeData ( string $dataKey, Behat\Gherkin\Node\TableNode $data ) : boolean
$dataKey string
$data Behat\Gherkin\Node\TableNode
리턴 boolean

collectHeaders() 공개 메소드

public collectHeaders ( $key, $value ) : void
리턴 void

collectLocations() 공개 메소드

public collectLocations ( $locationIndex ) : boolean
리턴 boolean

decodeJson() 보호된 메소드

Decode JSON string.
또한 보기: http://www.php.net/json_last_error
protected decodeJson ( string $string ) : mixed
$string string A JSON string.
리턴 mixed

echoLastResponse() 공개 메소드

public echoLastResponse ( ) : void
리턴 void

fieldIsOfTypeWithValue() 공개 메소드

public fieldIsOfTypeWithValue ( string $fieldName, string $type, string $fieldValue ) : void
$fieldName string
$type string
$fieldValue string
리턴 void

getResponse() 공개 메소드

This public method is also for other context(s) to get and process REST API response.
public getResponse ( ) : Guzzle\Http\Message\Response
리턴 Guzzle\Http\Message\Response

getResponseData() 공개 메소드

This public method is also for other context(s) to get and process REST API response.
public getResponseData ( ) : mixed
리턴 mixed

iRequest() 공개 메소드

public iRequest ( string $pageUrl ) : void
$pageUrl string
리턴 void

iSubmitDataTo() 공개 메소드

public iSubmitDataTo ( $dataKey, string $pageUrl ) : void
$pageUrl string
리턴 void

processPageUrl() 공개 메소드

public processPageUrl ( $pageUrl )

processResponse() 공개 메소드

This public method is also for other context(s) to process REST API call and inject response into this context.
public processResponse ( Buzz\Message\Response $response = null, boolean $asJson = true ) : void
$response Buzz\Message\Response
$asJson boolean Process the response as JSON or not.
리턴 void

processResponseBody() 보호된 메소드

Process response body. This method may also be used by other context(s) to process REST API call and inject response body into this context by using 2nd parameter $asJson.
protected processResponseBody ( string $jsonData, boolean $asJson = true ) : void
$jsonData string
$asJson boolean
리턴 void

saveFieldValueUnderLocation() 공개 메소드

public saveFieldValueUnderLocation ( string $fieldName, string $locationIndex ) : Behat\Behat\Context\Step\Then | void
$fieldName string
$locationIndex string
리턴 Behat\Behat\Context\Step\Then | void

thatIWantToDelete() 공개 메소드

public thatIWantToDelete ( ) : void
리턴 void

thatIWantToFind() 공개 메소드

public thatIWantToFind ( ) : void
리턴 void

thatIWantToMakeANew() 공개 메소드

public thatIWantToMakeANew ( ) : void
리턴 void

thatIWantToUpdate() 공개 메소드

public thatIWantToUpdate ( ) : void
리턴 void

theResponseHasAField() 공개 메소드

public theResponseHasAField ( string $name ) : void
$name string
리턴 void

theResponseIsJson() 공개 메소드

public theResponseIsJson ( string $notJson = '' ) : void
$notJson string
리턴 void

theResponseShouldBe() 공개 메소드

public theResponseShouldBe ( string $string ) : void
$string string
리턴 void

theResponseShouldContain() 공개 메소드

public theResponseShouldContain ( string $str ) : void
$str string
리턴 void

theResponseShouldNotHaveAField() 공개 메소드

public theResponseShouldNotHaveAField ( string $name ) : void
$name string
리턴 void

theResponseStatusCodeShouldBe() 공개 메소드

public theResponseStatusCodeShouldBe ( integer $httpStatus ) : void
$httpStatus integer
리턴 void

valueOfTheFieldEquals() 공개 메소드

public valueOfTheFieldEquals ( string $fieldName, string $fieldValue ) : void
$fieldName string
$fieldValue string
리턴 void

프로퍼티 상세

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

Client access_token
protected string $access_token
리턴 string

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

Specifies if the response data should be an associative array or a nested stdClass object hierarchy.
protected bool $associative
리턴 boolean

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

protected Browser,Buzz $client
리턴 Buzz\Browser

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

Data collected from steps
protected string $collectedData
리턴 string

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

Headers
protected array $headers
리턴 array

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

Locations collected from steps
protected array $locations
리턴 array

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

protected string $requestMethod
리턴 string

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

Used for debugging purpose only.
protected string $requestUrl
리턴 string

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

protected Response,Buzz\Message $response
리턴 Buzz\Message\Response

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

Data decoded from HTTP response.
protected mixed $responseData
리턴 mixed

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

protected Exception $responseDecodeException
리턴 Exception

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

protected bool $responseIsJson
리턴 boolean