$form_state =
new FormState();
$form_state ->
addBuildInfo('callback_object',
$form_object) ->
set(['content_translation', 'translation_form'
],
$translation_form);
if ($is_submitted) { $form_state->
setSubmitted();
} $form_state->
setRebuild($is_rebuilding);
$handler =
$this->entityTypeManager->
getHandler($this->entityTypeId, 'translation'
);
$actual =
$handler->
entityFormSharedElements($element,
$form_state,
$element);
$this->
assertEquals($expected,
$actual);
if ($display_warning) { $messages =
$this->messenger->
messagesByType('warning'
);
$this->
assertCount(1,
$messages);
$expected_message =
sprintf('Fields that apply to all languages are hidden to avoid conflicting changes. <a href="%s">Edit them on the original language form</a>.',
$entity->
toUrl('edit-form'
)->
toString());
$this->
assertSame($expected_message,
(string) reset($messages));
} } /**
* Returns test cases for ::testEntityFormSharedElements().
*
* @return array[]
* An array of test cases, each one containing the element to alter, the
* form state, and the expected altered element.
*/