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

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

Test for the updateContent() method.
    public function testUpdateContentThrowsContentValidationExceptionUntranslatableField()
    {
        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_untranslatable', 'Jabberwock', 'eng-US');
        // Throws an exception because translation was given for a untranslatable field
        // Note that it is still permissible to set untranslatable field with main language
        $updatedContent = $contentService->updateContent($versionInfo, $contentUpdateStruct);
        /* END: Use Case */
    }
ContentBase