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

testAddFieldDefinitionWithSettings() public method

Test for the addFieldDefinition() method.
    public function testAddFieldDefinitionWithSettings()
    {
        $contentTypeDraft = $this->createDraftContentType();
        $contentTypeService = $this->repository->getContentTypeService();
        $fieldDefCreate = $contentTypeService->newFieldDefinitionCreateStruct('body2', 'ezrichtext');
        $fieldDefCreate->names = array('eng-US' => 'Body', 'ger-DE' => 'Körper');
        $fieldDefCreate->descriptions = array('eng-US' => 'Body of the blog post', 'ger-DE' => 'Körper der den Blog-Post');
        $fieldDefCreate->fieldGroup = 'blog-content';
        $fieldDefCreate->position = 1;
        $fieldDefCreate->isTranslatable = true;
        $fieldDefCreate->isRequired = false;
        $fieldDefCreate->isInfoCollector = false;
        $fieldDefCreate->defaultValue = new RichTextValue();
        $fieldDefCreate->validatorConfiguration = array();
        $fieldDefCreate->fieldSettings = array('numRows' => 10);
        $fieldDefCreate->isSearchable = true;
        $contentTypeService->addFieldDefinition($contentTypeDraft, $fieldDefCreate);
        $loadedType = $contentTypeService->loadContentTypeDraft($contentTypeDraft->id);
        $this->assertInstanceOf('eZ\\Publish\\API\\Repository\\Values\\ContentType\\ContentTypeDraft', $loadedType);
        $this->assertAddFieldDefinitionStructValues($loadedType, $fieldDefCreate);
    }
ContentTypeBase