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

testRemoveFieldDefinitionThrowsInvalidArgumentException() public method

Test for the removeFieldDefinition() method.
    public function testRemoveFieldDefinitionThrowsInvalidArgumentException()
    {
        $draftId = $this->createDraftContentType()->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);
        // Throws an exception because "body" has already been removed
        $contentTypeService->removeFieldDefinition($contentTypeDraft, $bodyField);
        /* END: Use Case */
    }
ContentTypeBase