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

testPublishContentTypeDraftThrowsBadStateException() public method

Test for the publishContentTypeDraft() method.
    public function testPublishContentTypeDraftThrowsBadStateException()
    {
        $contentTypeDraft = $this->createDraftContentType();
        $draftId = $contentTypeDraft->id;
        /* BEGIN: Use Case */
        // $contentTypeDraft contains a ContentTypeDraft
        $contentTypeService = $this->repository->getContentTypeService();
        $contentTypeDraft = $contentTypeService->loadContentTypeDraft($draftId);
        $contentTypeService->publishContentTypeDraft($contentTypeDraft);
        // Throws exception, since no draft exists anymore
        $contentTypeService->publishContentTypeDraft($contentTypeDraft);
        /* END: Use Case */
    }
ContentTypeBase