eZ\Publish\Core\Repository\Tests\Service\Integration\ContentBase::testUpdateContentRequiredFieldEmpty PHP Метод

testUpdateContentRequiredFieldEmpty() публичный Метод

Test for the updateContent() method.
    public function testUpdateContentRequiredFieldEmpty()
    {
        list($content, $contentType) = $this->createTestContent();
        /* BEGIN: Use Case */
        $contentService = $this->repository->getContentService();
        $versionInfo = $contentService->loadVersionInfoById($content->id, $content->getVersionInfo()->versionNo);
        $contentUpdateStruct = $contentService->newContentUpdateStruct();
        $contentUpdateStruct->initialLanguageCode = 'eng-GB';
        $contentUpdateStruct->setField('test_required_empty', '');
        // Throws an exception because required field is being updated with empty value
        $updatedContent = $contentService->updateContent($versionInfo, $contentUpdateStruct);
        /* END: Use Case */
    }
ContentBase