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

testRemoveFieldDefinition() public method

Test for the removeFieldDefinition() method.
public testRemoveFieldDefinition ( ) : array
return array
    public function testRemoveFieldDefinition()
    {
        $contentTypeDraft = $this->createDraftContentType();
        $draftId = $contentTypeDraft->id;
        /* BEGIN: Use Case */
        // $draftId contains the ID of a content type draft
        $contentTypeService = $this->repository->getContentTypeService();
        $contentTypeDraft = $contentTypeService->loadContentTypeDraft($draftId);
        $bodyField = $contentTypeDraft->getFieldDefinition('body');
        $contentTypeService->removeFieldDefinition($contentTypeDraft, $bodyField);
        /* END: Use Case */
        $loadedType = $contentTypeService->loadContentTypeDraft($contentTypeDraft->id);
        $this->assertInstanceOf('eZ\\Publish\\API\\Repository\\Values\\ContentType\\ContentTypeDraft', $loadedType);
        return array('removedFieldDefinition' => $bodyField, 'loadedType' => $loadedType);
    }
ContentTypeBase