->
onlyMethods(['defaultValueWidget'
]) ->
setConstructorArgs([$field_definition]) ->
getMock();
$field_list->
expects($this->
any()) ->
method('defaultValueWidget'
) ->
willReturn(NULL
);
$form =
[];
$form_state =
new FormState();
$string_translation =
$this->
getStringTranslationStub();
$field_list->
setStringTranslation($string_translation);
$this->
assertEquals('No widget available for: <em class="placeholder">field_type</em>.',
$field_list->
defaultValuesForm($form,
$form_state)['#markup'
]);
} /**
* @covers ::defaultValuesFormValidate
*/
public function testDefaultValuesFormValidate() { $field_definition =
$this->
createMock(FieldDefinitionInterface::
class);
/** @var \Drupal\Core\Field\FieldItemList|\PHPUnit\Framework\MockObject\MockObject $field_list */
$field_list =
$this->
getMockBuilder(FieldItemList::
class) ->
onlyMethods(['defaultValueWidget', 'validate'
]) ->
setConstructorArgs([$field_definition])