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

testUpdateFieldDefinitionWithValidatorConfiguration() public method

Test for the updateFieldDefinition() method.
    public function testUpdateFieldDefinitionWithValidatorConfiguration()
    {
        $draftId = $this->createDraftContentType()->id;
        $contentTypeService = $this->repository->getContentTypeService();
        $contentTypeDraft = $contentTypeService->loadContentTypeDraft($draftId);
        $fieldDefinition = $contentTypeDraft->getFieldDefinition('title');
        $fieldDefinitionUpdateStruct = $contentTypeService->newFieldDefinitionUpdateStruct();
        $fieldDefinitionUpdateStruct->validatorConfiguration = array('StringLengthValidator' => array('minStringLength' => (int) $fieldDefinition->validatorConfiguration['StringLengthValidator']['minStringLength'] + 1, 'maxStringLength' => (int) $fieldDefinition->validatorConfiguration['StringLengthValidator']['maxStringLength'] + 1));
        $contentTypeService->updateFieldDefinition($contentTypeDraft, $fieldDefinition, $fieldDefinitionUpdateStruct);
        $contentTypeDraft = $contentTypeService->loadContentTypeDraft($draftId);
        $updatedFieldDefinition = $contentTypeDraft->getFieldDefinition('title');
        $this->assertInstanceOf('eZ\\Publish\\API\\Repository\\Values\\ContentType\\FieldDefinition', $updatedFieldDefinition);
        $this->assertUpdateFieldDefinitionStructValues($fieldDefinition, $updatedFieldDefinition, $fieldDefinitionUpdateStruct);
    }
ContentTypeBase