PHP Class eZ\Publish\Core\Repository\Tests\Service\Integration\ContentBase

Inheritance: extends Base
Show file Open project: ezsystems/ezpublish-kernel

Protected Properties

Property Type Description
$testContentType

Public Methods

Method Description
testAddRelationThrowsBadStateException ( ) Test for the addRelation() method.
testAddRelationThrowsUnauthorizedException ( ) Test for the addRelation() method.
testCopyContentAllVersions ( ) Test for the copyContent() method.
testCopyContentSingleVersion ( ) Test for the copyContent() method.
testCopyContentThrowsUnauthorizedException ( ) Test for the copyContent() method.
testCreateContent ( ) : array Test for the createContent() method.
testCreateContentDraft ( ) : array Test for the createContentDraft() method.
testCreateContentDraftThrowsBadStateException ( ) Test for the createContentDraft() method.
testCreateContentDraftThrowsUnauthorizedException ( ) Test for the createContentDraft() method.
testCreateContentDraftValues ( array $data ) Test for the createContentDraft() method.
testCreateContentDraftWithSecondArgument ( ) : array Test for the createContentDraft() method.
testCreateContentDraftWithSecondArgumentValues ( array $data ) Test for the createContentDraft() method.
testCreateContentDraftWithThirdArgument ( ) : array Test for the createContentDraft() method.
testCreateContentDraftWithThirdArgumentValues ( array $data ) Test for the createContentDraft() method.
testCreateContentRequiredFieldDefaultValueEmpty ( ) : array Test for the createContent() method.
testCreateContentStructValues ( array $data ) Test for the createContent() method.
testCreateContentStructValuesLoaded ( array $data ) Test for the createContent() method.
testCreateContentThrowsContentFieldValidationException ( ) Test for the createContent() method.
testCreateContentThrowsContentValidationExceptionFieldDefinitionUnexisting ( ) : array Test for the createContent() method.
testCreateContentThrowsContentValidationExceptionUntranslatableField ( ) : array Test for the createContent() method.
testCreateContentThrowsInvalidArgumentException ( ) Test for the createContent() method.
testCreateContentThrowsUnauthorizedException ( ) Test for the createContent() method.
testCreateContentWithoutLocationsThrowsUnauthorizedException ( ) Test for the createContent() method.
testDeleteRelation ( ) Test for the deleteRelation() method.
testDeleteRelationThrowsBadStateException ( ) Test for the deleteRelation() method.
testDeleteRelationThrowsInvalidArgumentException ( ) Test for the deleteRelation() method.
testDeleteRelationThrowsUnauthorizedException ( ) Test for the deleteRelation() method.
testDeleteVersion ( ) Test for the deleteVersion() method.
testDeleteVersionThrowsBadStateException ( ) Test for the deleteVersion() method.
testDeleteVersionThrowsUnauthorizedException ( ) Test for the deleteVersion() method.
testLoadContent ( integer $contentId, array $languages = null, integer $versionNo = null ) : eZ\Publish\API\Repository\Values\Content\Content Test for the loadContent() method.
testLoadContentArgumentsProvider ( ) : array Data provider for testLoadContent().
testLoadContentByRemoteId ( string $remoteId, array | null $languages, integer $versionNo ) : eZ\Publish\API\Repository\Values\Content\Content Test for the loadContentByRemoteId() method.
testLoadContentByRemoteIdArgumentsProvider ( ) : array Data provider for testLoadContentByRemoteId().
testLoadContentByRemoteIdThrowsNotFoundException ( ) Test for the loadContentByRemoteId() method.
testLoadContentByRemoteIdThrowsUnauthorizedException ( ) Test for the loadContentByRemoteId() method.
testLoadContentByRemoteIdWithVersionThrowsUnauthorizedException ( ) Test for the loadContentByRemoteId() method.
testLoadContentDrafts ( ) Test for the loadContentDrafts() method.
testLoadContentDraftsThrowsUnauthorizedException ( ) Test for the loadContentDrafts() method.
testLoadContentDraftsWithFirstArgument ( ) Test for the loadContentDrafts() method.
testLoadContentInfo ( ) : eZ\Publish\API\Repository\Values\Content\ContentInfo Test for the loadContentInfo() method.
testLoadContentInfoByRemoteId ( ) : eZ\Publish\API\Repository\Values\Content\ContentInfo Test for the loadContentInfoByRemoteId() method.
testLoadContentInfoByRemoteIdThrowsNotFoundException ( ) Test for the loadContentInfoByRemoteId() method.
testLoadContentInfoByRemoteIdThrowsUnauthorizedException ( ) Test for the loadContentInfoByRemoteId() method.
testLoadContentInfoByRemoteIdValues ( eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo ) Test for the loadContentInfoByRemoteId() method.
testLoadContentInfoThrowsNotFoundException ( ) Test for the loadContentInfo() method.
testLoadContentInfoThrowsUnauthorizedException ( ) Test for the loadContentInfo() method.
testLoadContentInfoValues ( eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo ) Test for the loadContentInfo() method.
testLoadContentThrowsNotFoundExceptionContentNotFound ( ) Test for the loadContent() method.
testLoadContentThrowsNotFoundExceptionLanguageNotFound ( ) Test for the loadContent() method.
testLoadContentThrowsNotFoundExceptionLanguageNotFoundVariation ( ) Test for the loadContent() method.
testLoadContentThrowsNotFoundExceptionVersionNotFound ( ) Test for the loadContent() method.
testLoadContentThrowsUnauthorizedException ( ) Test for the loadContent() method.
testLoadContentWithVersionThrowsUnauthorizedException ( ) Test for the loadContent() method.
testLoadRelations ( ) Test for the loadRelations() method.
testLoadRelationsThrowsUnauthorizedException ( ) Test for the loadRelations() method.
testLoadReverseRelationsThrowsUnauthorizedException ( ) Test for the loadReverseRelations() method.
testLoadVersionInfoById ( ) : eZ\Publish\API\Repository\Values\Content\VersionInfo Test for the loadVersionInfoById() method.
testLoadVersionInfoByIdThrowsNotFoundException ( ) Test for the loadVersionInfoById() method.
testLoadVersionInfoByIdThrowsUnauthorizedException ( ) Test for the loadVersionInfoById() method.
testLoadVersionInfoByIdValues ( eZ\Publish\API\Repository\Values\Content\VersionInfo $versionInfo ) Test for the loadVersionInfoById() method.
testLoadVersionInfoByIdWithSecondParameter ( ) : eZ\Publish\API\Repository\Values\Content\VersionInfo Test for the loadVersionInfoById() method.
testLoadVersionInfoByIdWithSecondParameterValues ( eZ\Publish\API\Repository\Values\Content\VersionInfo $versionInfo ) Test for the loadVersionInfoById() method.
testLoadVersions ( ) : eZ\Publish\API\Repository\Values\Content\VersionInfo[] Test for the loadVersions() method.
testLoadVersionsMultiple ( ) : eZ\Publish\API\Repository\Values\Content\VersionInfo[] Test for the loadVersions() method.
testLoadVersionsMultipleValues ( array $data ) Test for the loadVersions() method.
testLoadVersionsThrowsUnauthorizedException ( ) Test for the loadVersions() method.
testLoadVersionsValues ( array $versions ) Test for the loadVersions() method.
testNewContentCreateStruct ( ) : eZ\Publish\API\Repository\Values\Content\ContentCreateStruct Test for the newContentCreateStruct() method.
testNewContentCreateStructValues ( array $data ) Test for the newContentCreateStruct() method.
testNewContentMetadataUpdateStruct ( ) Test for the newContentMetadataUpdateStruct() method.
testNewContentUpdateStruct ( ) Test for the newContentUpdateStruct() method.
testNewTranslationInfo ( ) Test for the newTranslationInfo() method.
testNewTranslationValues ( ) Test for the newTranslationValues() method.
testPublishVersion ( ) Test for the publishVersion() method.
testPublishVersionDoesNotChangePublishedDate ( )
testPublishVersionThrowsBadStateException ( ) Test for the publishVersion() method.
testPublishVersionThrowsUnauthorizedException ( ) Test for the publishVersion() method.
testUpdateContentMetadata ( ) : array Test for the updateContentMetadata() method.
testUpdateContentMetadataStructValues ( array $data ) Test for the updateContentMetadata() method.
testUpdateContentMetadataThrowsInvalidArgumentExceptionDuplicateRemoteId ( ) Test for the updateContentMetadata() method.
testUpdateContentMetadataThrowsInvalidArgumentExceptionNoMetadataPropertiesSet ( ) Test for the updateContentMetadata() method.
testUpdateContentMetadataThrowsUnauthorizedException ( ) Test for the updateContentMetadata() method.
testUpdateContentRequiredFieldEmpty ( ) Test for the updateContent() method.
testUpdateContentThrowsBadStateException ( ) Test for the updateContent() method.
testUpdateContentThrowsContentFieldValidationException ( ) Test for the updateContent() method.
testUpdateContentThrowsContentValidationExceptionFieldDefinitionNonexistent ( ) Test for the updateContent() method.
testUpdateContentThrowsContentValidationExceptionUntranslatableField ( ) : array Test for the updateContent() method.
testUpdateContentThrowsUnauthorizedException ( ) Test for the updateContent() method.

Protected Methods

Method Description
assertContentValues ( eZ\Publish\API\Repository\Values\Content\Content $content, array $languages = null, boolean $draft = false )
assertCopyContentValues ( eZ\Publish\API\Repository\Values\Content\Content $originalContent, eZ\Publish\API\Repository\Values\Content\Content $copiedContent ) Asserts that $copiedContent is valid copy of $originalContent.
assertCreateContentStructValues ( array $data ) Test for the createContent() method.
assertCreateContentStructValuesContentInfo ( array $data ) Asserts that ContentInfo is valid after Content creation.
assertCreateContentStructValuesFields ( array $data ) Asserts that fields are valid after Content creation.
assertCreateContentStructValuesRelations ( array $data )
assertCreateContentStructValuesVersionInfo ( array $data ) Asserts that VersionInfo is valid after Content creation.
assertDraftContentValues ( array $data )
assertRelations ( $relations, $sourceContentInfo, $destinationContentInfo )
createTestContent ( ) : eZ\Publish\API\Repository\Values\Content\Content Creates and returns content draft used in testing.
createTestContentType ( ) : eZ\Publish\API\Repository\Values\ContentType\ContentType Returns ContentType used in testing.
getContentInfoExpectedValues ( )
getExpectedContentType ( )
getFieldValuesExpectedValues ( array $languages = null ) : mixed
getLanguageCodesFromFields ( array $fields, string $mainLanguageCode ) : array Gathers language codes from an array of fields.
getVersionInfoExpectedValues ( boolean $draft = false ) : array

Method Details

assertContentValues() protected method

protected assertContentValues ( eZ\Publish\API\Repository\Values\Content\Content $content, array $languages = null, boolean $draft = false )
$content eZ\Publish\API\Repository\Values\Content\Content
$languages array
$draft boolean

assertCopyContentValues() protected method

Asserts that $copiedContent is valid copy of $originalContent.
protected assertCopyContentValues ( eZ\Publish\API\Repository\Values\Content\Content $originalContent, eZ\Publish\API\Repository\Values\Content\Content $copiedContent )
$originalContent eZ\Publish\API\Repository\Values\Content\Content
$copiedContent eZ\Publish\API\Repository\Values\Content\Content

assertCreateContentStructValues() protected method

Test for the createContent() method.
protected assertCreateContentStructValues ( array $data )
$data array

assertCreateContentStructValuesContentInfo() protected method

Asserts that ContentInfo is valid after Content creation.

assertCreateContentStructValuesFields() protected method

Asserts that fields are valid after Content creation.

assertCreateContentStructValuesRelations() protected method

assertCreateContentStructValuesVersionInfo() protected method

Asserts that VersionInfo is valid after Content creation.

assertDraftContentValues() protected method

protected assertDraftContentValues ( array $data )
$data array

assertRelations() protected method

protected assertRelations ( $relations, $sourceContentInfo, $destinationContentInfo )

createTestContent() protected method

Creates and returns content draft used in testing.
protected createTestContent ( ) : eZ\Publish\API\Repository\Values\Content\Content
return eZ\Publish\API\Repository\Values\Content\Content

createTestContentType() protected method

Returns ContentType used in testing.
protected createTestContentType ( ) : eZ\Publish\API\Repository\Values\ContentType\ContentType
return eZ\Publish\API\Repository\Values\ContentType\ContentType

getContentInfoExpectedValues() protected method

getExpectedContentType() protected method

protected getExpectedContentType ( )

getFieldValuesExpectedValues() protected method

protected getFieldValuesExpectedValues ( array $languages = null ) : mixed
$languages array
return mixed

getLanguageCodesFromFields() protected method

Gathers language codes from an array of fields.
protected getLanguageCodesFromFields ( array $fields, string $mainLanguageCode ) : array
$fields array
$mainLanguageCode string
return array an array of language code strings

getVersionInfoExpectedValues() protected method

protected getVersionInfoExpectedValues ( boolean $draft = false ) : array
$draft boolean
return array

testAddRelationThrowsBadStateException() public method

Test for the addRelation() method.

testAddRelationThrowsUnauthorizedException() public method

Test for the addRelation() method.

testCopyContentAllVersions() public method

Test for the copyContent() method.

testCopyContentSingleVersion() public method

Test for the copyContent() method.

testCopyContentThrowsUnauthorizedException() public method

Test for the copyContent() method.

testCreateContent() public method

Test for the createContent() method.
public testCreateContent ( ) : array
return array

testCreateContentDraft() public method

Test for the createContentDraft() method.
public testCreateContentDraft ( ) : array
return array

testCreateContentDraftThrowsBadStateException() public method

Test for the createContentDraft() method.

testCreateContentDraftThrowsUnauthorizedException() public method

Test for the createContentDraft() method.

testCreateContentDraftValues() public method

Test for the createContentDraft() method.
public testCreateContentDraftValues ( array $data )
$data array

testCreateContentDraftWithSecondArgument() public method

Test for the createContentDraft() method.

testCreateContentDraftWithSecondArgumentValues() public method

Test for the createContentDraft() method.

testCreateContentDraftWithThirdArgument() public method

Test for the createContentDraft() method.

testCreateContentDraftWithThirdArgumentValues() public method

Test for the createContentDraft() method.

testCreateContentRequiredFieldDefaultValueEmpty() public method

Test for the createContent() method.

testCreateContentStructValues() public method

Test for the createContent() method.
public testCreateContentStructValues ( array $data )
$data array

testCreateContentStructValuesLoaded() public method

Because of the way ContentHandler::create() is implemented and tested in legacy storage it is also necessary to test loaded content object, not only the one returned by ContentService::createContent

testCreateContentThrowsContentFieldValidationException() public method

Test for the createContent() method.

testCreateContentThrowsContentValidationExceptionFieldDefinitionUnexisting() public method

Test for the createContent() method.

testCreateContentThrowsContentValidationExceptionUntranslatableField() public method

Test for the createContent() method.

testCreateContentThrowsInvalidArgumentException() public method

Test for the createContent() method.

testCreateContentThrowsUnauthorizedException() public method

Test for the createContent() method.

testCreateContentWithoutLocationsThrowsUnauthorizedException() public method

Test for the createContent() method.

testDeleteRelation() public method

Test for the deleteRelation() method.
public testDeleteRelation ( )

testDeleteRelationThrowsBadStateException() public method

Test for the deleteRelation() method.

testDeleteRelationThrowsInvalidArgumentException() public method

Test for the deleteRelation() method.

testDeleteRelationThrowsUnauthorizedException() public method

Test for the deleteRelation() method.

testDeleteVersion() public method

Test for the deleteVersion() method.
public testDeleteVersion ( )

testDeleteVersionThrowsBadStateException() public method

Test for the deleteVersion() method.

testDeleteVersionThrowsUnauthorizedException() public method

Test for the deleteVersion() method.

testLoadContent() public method

Test for the loadContent() method.
public testLoadContent ( integer $contentId, array $languages = null, integer $versionNo = null ) : eZ\Publish\API\Repository\Values\Content\Content
$contentId integer
$languages array
$versionNo integer
return eZ\Publish\API\Repository\Values\Content\Content

testLoadContentArgumentsProvider() public method

Data provider for testLoadContent().

testLoadContentByRemoteId() public method

Test for the loadContentByRemoteId() method.
public testLoadContentByRemoteId ( string $remoteId, array | null $languages, integer $versionNo ) : eZ\Publish\API\Repository\Values\Content\Content
$remoteId string
$languages array | null
$versionNo integer
return eZ\Publish\API\Repository\Values\Content\Content

testLoadContentByRemoteIdArgumentsProvider() public method

Data provider for testLoadContentByRemoteId().

testLoadContentByRemoteIdThrowsNotFoundException() public method

Test for the loadContentByRemoteId() method.

testLoadContentByRemoteIdThrowsUnauthorizedException() public method

Test for the loadContentByRemoteId() method.

testLoadContentByRemoteIdWithVersionThrowsUnauthorizedException() public method

Test for the loadContentByRemoteId() method.

testLoadContentDrafts() public method

Test for the loadContentDrafts() method.

testLoadContentDraftsThrowsUnauthorizedException() public method

Test for the loadContentDrafts() method.

testLoadContentDraftsWithFirstArgument() public method

Test for the loadContentDrafts() method.

testLoadContentInfo() public method

Test for the loadContentInfo() method.
public testLoadContentInfo ( ) : eZ\Publish\API\Repository\Values\Content\ContentInfo
return eZ\Publish\API\Repository\Values\Content\ContentInfo

testLoadContentInfoByRemoteId() public method

Test for the loadContentInfoByRemoteId() method.
public testLoadContentInfoByRemoteId ( ) : eZ\Publish\API\Repository\Values\Content\ContentInfo
return eZ\Publish\API\Repository\Values\Content\ContentInfo

testLoadContentInfoByRemoteIdThrowsNotFoundException() public method

Test for the loadContentInfoByRemoteId() method.

testLoadContentInfoByRemoteIdThrowsUnauthorizedException() public method

Test for the loadContentInfoByRemoteId() method.

testLoadContentInfoByRemoteIdValues() public method

Test for the loadContentInfoByRemoteId() method.
public testLoadContentInfoByRemoteIdValues ( eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo )
$contentInfo eZ\Publish\API\Repository\Values\Content\ContentInfo

testLoadContentInfoThrowsNotFoundException() public method

Test for the loadContentInfo() method.

testLoadContentInfoThrowsUnauthorizedException() public method

Test for the loadContentInfo() method.

testLoadContentInfoValues() public method

Test for the loadContentInfo() method.
public testLoadContentInfoValues ( eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo )
$contentInfo eZ\Publish\API\Repository\Values\Content\ContentInfo

testLoadContentThrowsNotFoundExceptionContentNotFound() public method

Test for the loadContent() method.

testLoadContentThrowsNotFoundExceptionLanguageNotFound() public method

Test for the loadContent() method.

testLoadContentThrowsNotFoundExceptionLanguageNotFoundVariation() public method

Test for the loadContent() method.

testLoadContentThrowsNotFoundExceptionVersionNotFound() public method

Test for the loadContent() method.

testLoadContentThrowsUnauthorizedException() public method

Test for the loadContent() method.

testLoadContentWithVersionThrowsUnauthorizedException() public method

Test for the loadContent() method.

testLoadRelations() public method

Test for the loadRelations() method.
public testLoadRelations ( )

testLoadRelationsThrowsUnauthorizedException() public method

Test for the loadRelations() method.

testLoadReverseRelationsThrowsUnauthorizedException() public method

Test for the loadReverseRelations() method.

testLoadVersionInfoById() public method

Test for the loadVersionInfoById() method.
public testLoadVersionInfoById ( ) : eZ\Publish\API\Repository\Values\Content\VersionInfo
return eZ\Publish\API\Repository\Values\Content\VersionInfo

testLoadVersionInfoByIdThrowsNotFoundException() public method

Test for the loadVersionInfoById() method.

testLoadVersionInfoByIdThrowsUnauthorizedException() public method

Test for the loadVersionInfoById() method.

testLoadVersionInfoByIdValues() public method

Test for the loadVersionInfoById() method.
public testLoadVersionInfoByIdValues ( eZ\Publish\API\Repository\Values\Content\VersionInfo $versionInfo )
$versionInfo eZ\Publish\API\Repository\Values\Content\VersionInfo

testLoadVersionInfoByIdWithSecondParameter() public method

Test for the loadVersionInfoById() method.
public testLoadVersionInfoByIdWithSecondParameter ( ) : eZ\Publish\API\Repository\Values\Content\VersionInfo
return eZ\Publish\API\Repository\Values\Content\VersionInfo

testLoadVersionInfoByIdWithSecondParameterValues() public method

Test for the loadVersionInfoById() method.
public testLoadVersionInfoByIdWithSecondParameterValues ( eZ\Publish\API\Repository\Values\Content\VersionInfo $versionInfo )
$versionInfo eZ\Publish\API\Repository\Values\Content\VersionInfo

testLoadVersions() public method

Test for the loadVersions() method.
public testLoadVersions ( ) : eZ\Publish\API\Repository\Values\Content\VersionInfo[]
return eZ\Publish\API\Repository\Values\Content\VersionInfo[]

testLoadVersionsMultiple() public method

Test for the loadVersions() method.
public testLoadVersionsMultiple ( ) : eZ\Publish\API\Repository\Values\Content\VersionInfo[]
return eZ\Publish\API\Repository\Values\Content\VersionInfo[]

testLoadVersionsMultipleValues() public method

Test for the loadVersions() method.
public testLoadVersionsMultipleValues ( array $data )
$data array

testLoadVersionsThrowsUnauthorizedException() public method

Test for the loadVersions() method.

testLoadVersionsValues() public method

Test for the loadVersions() method.
public testLoadVersionsValues ( array $versions )
$versions array

testNewContentCreateStruct() public method

Test for the newContentCreateStruct() method.
public testNewContentCreateStruct ( ) : eZ\Publish\API\Repository\Values\Content\ContentCreateStruct
return eZ\Publish\API\Repository\Values\Content\ContentCreateStruct

testNewContentCreateStructValues() public method

Test for the newContentCreateStruct() method.

testNewContentMetadataUpdateStruct() public method

Test for the newContentMetadataUpdateStruct() method.

testNewContentUpdateStruct() public method

Test for the newContentUpdateStruct() method.

testNewTranslationInfo() public method

Test for the newTranslationInfo() method.

testNewTranslationValues() public method

Test for the newTranslationValues() method.

testPublishVersion() public method

Test for the publishVersion() method.
public testPublishVersion ( )

testPublishVersionDoesNotChangePublishedDate() public method

testPublishVersionThrowsBadStateException() public method

Test for the publishVersion() method.

testPublishVersionThrowsUnauthorizedException() public method

Test for the publishVersion() method.

testUpdateContentMetadata() public method

Test for the updateContentMetadata() method.
public testUpdateContentMetadata ( ) : array
return array

testUpdateContentMetadataStructValues() public method

Test for the updateContentMetadata() method.

testUpdateContentMetadataThrowsInvalidArgumentExceptionDuplicateRemoteId() public method

Test for the updateContentMetadata() method.

testUpdateContentMetadataThrowsInvalidArgumentExceptionNoMetadataPropertiesSet() public method

Test for the updateContentMetadata() method.

testUpdateContentMetadataThrowsUnauthorizedException() public method

Test for the updateContentMetadata() method.

testUpdateContentRequiredFieldEmpty() public method

Test for the updateContent() method.

testUpdateContentThrowsBadStateException() public method

Test for the updateContent() method.

testUpdateContentThrowsContentFieldValidationException() public method

Test for the updateContent() method.

testUpdateContentThrowsContentValidationExceptionFieldDefinitionNonexistent() public method

Test for the updateContent() method.

testUpdateContentThrowsContentValidationExceptionUntranslatableField() public method

Test for the updateContent() method.

testUpdateContentThrowsUnauthorizedException() public method

Test for the updateContent() method.

Property Details

$testContentType protected property

protected $testContentType