public function testCreateContentTypeThrowsInvalidArgumentExceptionContentTypeExistsWithRemoteId() { /* BEGIN: Use Case */ $contentTypeService = $this->repository->getContentTypeService(); // Creates published content type with remoteId "new-remoteid" $this->createPublishedContentType(); $typeCreateStruct = $contentTypeService->newContentTypeCreateStruct('other-type'); $typeCreateStruct->remoteId = 'new-remoteid'; $typeCreateStruct->creatorId = $this->repository->getCurrentUserReference()->getUserId(); $typeCreateStruct->creationDate = new \DateTime(); $typeCreateStruct->mainLanguageCode = 'eng-US'; $typeCreateStruct->names = array('eng-US' => 'A name.'); $typeCreateStruct->descriptions = array('eng-US' => 'A description.'); $fieldCreate = $contentTypeService->newFieldDefinitionCreateStruct('test', 'eztext'); $typeCreateStruct->addFieldDefinition($fieldCreate); // Throws an exception because content type with remoteId "new-remoteid" already exists $type = $contentTypeService->createContentType($typeCreateStruct, array($contentTypeService->loadContentTypeGroup(1))); /* END: Use Case */ }