eZ\Publish\Core\Repository\Tests\Service\Integration\ContentTypeBase::testAddFieldDefinitionThrowsInvalidArgumentExceptionDuplicateFieldIdentifier PHP Method

testAddFieldDefinitionThrowsInvalidArgumentExceptionDuplicateFieldIdentifier() public method

Test for the addFieldDefinition() method.
    public function testAddFieldDefinitionThrowsInvalidArgumentExceptionDuplicateFieldIdentifier()
    {
        $contentTypeDraft = $this->createDraftContentType();
        /* BEGIN: Use Case */
        // $contentTypeDraft contains a ContentTypeDraft
        // $contentTypeDraft has a field "title"
        $contentTypeService = $this->repository->getContentTypeService();
        $fieldDefCreate = $contentTypeService->newFieldDefinitionCreateStruct('title', 'string');
        // Throws an exception
        $contentTypeService->addFieldDefinition($contentTypeDraft, $fieldDefCreate);
        /* END: Use Case */
    }
ContentTypeBase