->
onlyMethods(['defaultValueWidget', 'validate'
]) ->
setConstructorArgs([$field_definition]) ->
getMock();
$field_list->
expects($this->
any()) ->
method('defaultValueWidget'
) ->
willReturn(NULL
);
$field_list->
expects($this->
never()) ->
method('validate'
);
$form =
[];
$form_state =
new FormState();
$field_list->
defaultValuesFormValidate([],
$form,
$form_state);
} /**
* @covers ::defaultValuesFormSubmit
*/
public function testDefaultValuesFormSubmit() { $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', 'getValue'
]) ->
setConstructorArgs([$field_definition])