public function testUpdateContentThrowsContentFieldValidationException() { 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-US'; $contentUpdateStruct->setField('test_required_empty', 'a string that is too long and will not validate 12345678901234567890123456789012345678901234567890'); // Throws an exception because "test_required_empty" field value is too long and fails // field definition's string length validator $updatedContent = $contentService->updateContent($versionInfo, $contentUpdateStruct); /* END: Use Case */ }