public testPublishContentTypeDraft ( ) |
public function testPublishContentTypeDraft()
{
$contentTypeDraft = $this->createDraftContentType();
$draftId = $contentTypeDraft->id;
/* BEGIN: Use Case */
// $contentTypeDraft contains a ContentTypeDraft
$contentTypeService = $this->repository->getContentTypeService();
$contentTypeDraft = $contentTypeService->loadContentTypeDraft($draftId);
$contentTypeService->publishContentTypeDraft($contentTypeDraft);
/* END: Use Case */
$publishedType = $contentTypeService->loadContentType($draftId);
$this->assertInstanceOf('eZ\\Publish\\API\\Repository\\Values\\ContentType\\ContentType', $publishedType);
$this->assertNotInstanceOf('eZ\\Publish\\API\\Repository\\Values\\ContentType\\ContentTypeDraft', $publishedType);
}