public testUpdateContentTypeDraft ( ) : array | ||
리턴 | array |
public function testUpdateContentTypeDraft()
{
$contentTypeDraft = $this->createDraftContentType();
/* BEGIN: Use Case */
// $contentTypeDraft contains a ContentTypeDraft
$contentTypeService = $this->repository->getContentTypeService();
$typeUpdate = $contentTypeService->newContentTypeUpdateStruct();
$typeUpdate->identifier = 'news-article';
$typeUpdate->remoteId = '4cf35f5166fd31bf0cda859dc837e095daee9833';
$typeUpdate->urlAliasSchema = 'url@alias|scheme';
$typeUpdate->nameSchema = '@name@scheme@';
$typeUpdate->isContainer = true;
$typeUpdate->mainLanguageCode = 'eng-US';
$typeUpdate->defaultAlwaysAvailable = false;
$typeUpdate->modifierId = $this->repository->getCurrentUserReference()->getUserId();
$typeUpdate->modificationDate = new \DateTime();
$typeUpdate->defaultSortField = Location::SORT_FIELD_PUBLISHED;
$typeUpdate->defaultSortOrder = Location::SORT_ORDER_ASC;
$typeUpdate->names = array('eng-US' => 'News article', 'eng-GB' => 'Nachrichten-Artikel');
$typeUpdate->descriptions = array('eng-US' => 'A news article', 'eng-GB' => 'Ein Nachrichten-Artikel');
$contentTypeService->updateContentTypeDraft($contentTypeDraft, $typeUpdate);
/* END: Use Case */
$updatedType = $contentTypeService->loadContentTypeDraft($contentTypeDraft->id);
$this->assertInstanceOf('eZ\\Publish\\API\\Repository\\Values\\ContentType\\ContentTypeDraft', $updatedType);
return array('originalType' => $contentTypeDraft, 'updateStruct' => $typeUpdate, 'updatedType' => $updatedType);
}