PHP 트레잇 eZ\Bundle\EzPublishRestBundle\Features\Context\SubContext\EzRest

파일 보기 프로젝트 열기: ezsystems/ezpublish-kernel

공개 프로퍼티들

프로퍼티 타입 설명
$requestObject eZ\Publish\API\Repository\Values\ValueObject Since there is a need to prepare an object in several steps it needs to be hold until sent to the request body.
$responseObject eZ\Publish\API\Repository\Values\ValueObject | Exception Same idea as the $requestObject, since we need to verify it step by step it need to be stored (as object) for testing.

공개 메소드들

메소드 설명
assertHeaderHasObject ( $header, $object )
assertObjectFieldHasValue ( $field, $value )
assertResponseErrorDescription ( $errorDescriptionRegEx )
assertResponseErrorStatusCode ( $code )
assertResponseObject ( string $object )
convertResponseBodyToObject ( string $responseBody, string $contentTypeHeader ) : eZ\Publish\API\Repository\Values\ValueObject Convert the body/content of a response into an object.
getRequestObject ( ) : eZ\Publish\API\Repository\Values\ValueObject Get the request object.
getResponseObject ( ) : eZ\Publish\API\Repository\Values\ValueObject Get the response object (if it's not converted do the conversion also).
iSetTheContentTypeHeaderToInVersion ( $contentType, $version )
makeObject ( $type )
setFieldToEmptyArray ( $field )
setFieldToValue ( $field, $value )
setHeaderWithObject ( $header, $object )

보호된 메소드들

메소드 설명
addObjectToRequestBody ( eZ\Publish\API\Repository\Values\ValueObject $object, string $type ) Convert an object and add it to the body/content of the request.
convertObjectTo ( eZ\Publish\API\Repository\Values\ValueObject $object, string $type ) : Response Convert an object to a request.
createRequestObject ( string $objectType ) Create an object of the specified type.
decomposeObjectHeader ( $header ) : false | string Decompose the header to get only the object type of the accept/conten-type headers.
getResponseError ( string $property ) : integer | mixed | string Get property from the returned Exception.
makeObjectHeader ( $object ) Make content-type/accept header with prefix and type.
setRestBodyType ( string $type ) Set body type of requests and responses.

메소드 상세

addObjectToRequestBody() 보호된 메소드

Convert an object and add it to the body/content of the request.
protected addObjectToRequestBody ( eZ\Publish\API\Repository\Values\ValueObject $object, string $type )
$object eZ\Publish\API\Repository\Values\ValueObject Object to be converted
$type string Type for the body of the request (XML, JSON)

assertHeaderHasObject() 공개 메소드

public assertHeaderHasObject ( $header, $object )

assertObjectFieldHasValue() 공개 메소드

public assertObjectFieldHasValue ( $field, $value )

assertResponseErrorDescription() 공개 메소드

public assertResponseErrorDescription ( $errorDescriptionRegEx )

assertResponseErrorStatusCode() 공개 메소드

assertResponseObject() 공개 메소드

public assertResponseObject ( string $object )
$object string Object should be the object name with namespace

convertObjectTo() 보호된 메소드

Convert an object to a request.
protected convertObjectTo ( eZ\Publish\API\Repository\Values\ValueObject $object, string $type ) : Response
$object eZ\Publish\API\Repository\Values\ValueObject Object to be converted
$type string Type for conversion
리턴 Symfony\Component\HttpFoundation\Response

convertResponseBodyToObject() 공개 메소드

Convert the body/content of a response into an object.
public convertResponseBodyToObject ( string $responseBody, string $contentTypeHeader ) : eZ\Publish\API\Repository\Values\ValueObject
$responseBody string Body/content of the response (with the object)
$contentTypeHeader string Value of the content-type header
리턴 eZ\Publish\API\Repository\Values\ValueObject

createRequestObject() 보호된 메소드

Create an object of the specified type.
protected createRequestObject ( string $objectType )
$objectType string the name of the object to be created

decomposeObjectHeader() 보호된 메소드

Decompose the header to get only the object type of the accept/conten-type headers.
protected decomposeObjectHeader ( $header ) : false | string
리턴 false | string Decomposed string if found, false other wise

getRequestObject() 공개 메소드

Get the request object.
public getRequestObject ( ) : eZ\Publish\API\Repository\Values\ValueObject
리턴 eZ\Publish\API\Repository\Values\ValueObject

getResponseError() 보호된 메소드

Get property from the returned Exception.
protected getResponseError ( string $property ) : integer | mixed | string
$property string Property to return
리턴 integer | mixed | string Property

getResponseObject() 공개 메소드

Get the response object (if it's not converted do the conversion also).
public getResponseObject ( ) : eZ\Publish\API\Repository\Values\ValueObject
리턴 eZ\Publish\API\Repository\Values\ValueObject

iSetTheContentTypeHeaderToInVersion() 공개 메소드

public iSetTheContentTypeHeaderToInVersion ( $contentType, $version )

makeObject() 공개 메소드

public makeObject ( $type )

makeObjectHeader() 보호된 메소드

Make content-type/accept header with prefix and type.
protected makeObjectHeader ( $object )

setFieldToEmptyArray() 공개 메소드

public setFieldToEmptyArray ( $field )

setFieldToValue() 공개 메소드

public setFieldToValue ( $field, $value )

setHeaderWithObject() 공개 메소드

public setHeaderWithObject ( $header, $object )

setRestBodyType() 보호된 메소드

Set body type of requests and responses.
protected setRestBodyType ( string $type )
$type string Type of the REST body

프로퍼티 상세

$requestObject 공개적으로 프로퍼티

Since there is a need to prepare an object in several steps it needs to be hold until sent to the request body.
public ValueObject,eZ\Publish\API\Repository\Values $requestObject
리턴 eZ\Publish\API\Repository\Values\ValueObject

$responseObject 공개적으로 프로퍼티

Same idea as the $requestObject, since we need to verify it step by step it need to be stored (as object) for testing.
public ValueObject,eZ\Publish\API\Repository\Values|Exception,eZ\Bundle\EzPublishRestBundle\Features\Context\SubContext $responseObject
리턴 eZ\Publish\API\Repository\Values\ValueObject | Exception