PHP Class eZ\Bundle\EzPublishRestBundle\Tests\Functional\TestCase

Inheritance: extends PHPUnit_Framework_TestCas\PHPUnit_Framework_TestCase
Show file Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$autoLogin boolean If true, a login request is automatically done during setUp().
$testSuffix

Public Methods

Method Description
createHttpRequest ( $method, $uri, $contentType = '', $acceptType = '' ) : Buzz\Message\Request
sendHttpRequest ( Buzz\Message\Request $request ) : Buzz\Message\Response
tearDownAfterClass ( )

Protected Methods

Method Description
addCreatedElement ( $href )
addTestSuffix ( $string )
assertHttpResponseCodeEquals ( Buzz\Message\Response $response, $expected )
assertHttpResponseHasHeader ( Buzz\Message\Response $response, $header, $expectedValue = null )
createContent ( $xml ) : array
createFolder ( $string, string $parentLocationId ) : array
generateMediaTypeString ( $typeString )
getContentLocations ( string $contentHref ) : array
getHttpHost ( )
getLoginPassword ( )
getLoginUsername ( )
login ( ) : stdClass Sends a login request to the REST server.
setSessionInput ( Buzz\Message\Request $request, string $password = null ) : string Sets the request's content to a JSON session creation payload.
setUp ( )

Private Methods

Method Description
clearCreatedElement ( array $contentArray )
getHttpResponseCodeErrorMessage ( $errorMessage )

Method Details

addCreatedElement() protected method

protected addCreatedElement ( $href )

addTestSuffix() protected method

protected addTestSuffix ( $string )

assertHttpResponseCodeEquals() protected method

protected assertHttpResponseCodeEquals ( Buzz\Message\Response $response, $expected )
$response Buzz\Message\Response

assertHttpResponseHasHeader() protected method

protected assertHttpResponseHasHeader ( Buzz\Message\Response $response, $header, $expectedValue = null )
$response Buzz\Message\Response

createContent() protected method

protected createContent ( $xml ) : array
$xml
return array Content key of the Content struct array

createFolder() protected method

protected createFolder ( $string, string $parentLocationId ) : array
$parentLocationId string The REST id of the parent location
return array created Content, as an array

createHttpRequest() public method

public createHttpRequest ( $method, $uri, $contentType = '', $acceptType = '' ) : Buzz\Message\Request
return Buzz\Message\Request

generateMediaTypeString() protected method

protected generateMediaTypeString ( $typeString )

getContentLocations() protected method

protected getContentLocations ( string $contentHref ) : array
$contentHref string
return array

getHttpHost() protected method

protected getHttpHost ( )

getLoginPassword() protected method

protected getLoginPassword ( )

getLoginUsername() protected method

protected getLoginUsername ( )

login() protected method

Sends a login request to the REST server.
protected login ( ) : stdClass
return stdClass an object with the name, identifier, csrftoken properties.

sendHttpRequest() public method

public sendHttpRequest ( Buzz\Message\Request $request ) : Buzz\Message\Response
$request Buzz\Message\Request
return Buzz\Message\Response

setSessionInput() protected method

Sets the request's content to a JSON session creation payload.
protected setSessionInput ( Buzz\Message\Request $request, string $password = null ) : string
$request Buzz\Message\Request
$password string The password to use in the input. Will use the default one if not set.
return string

setUp() protected method

protected setUp ( )

tearDownAfterClass() public static method

public static tearDownAfterClass ( )

Property Details

$autoLogin protected property

If true, a login request is automatically done during setUp().
protected bool $autoLogin
return boolean

$testSuffix protected static property

protected static $testSuffix