->
method('createFieldItem'
) ->
willReturnOnConsecutiveCalls($first_field_item,
$second_field_item);
// Set the field item values.
if ($first_field_item instanceof FieldItemInterface
) { $field_list_a->
setValue($first_field_item);
} if ($second_field_item instanceof FieldItemInterface
) { $field_list_b->
setValue($second_field_item);
} $this->
assertEquals($expected, !
$field_list_a->
hasAffectingChanges($field_list_b, ''
));
} /**
* @covers ::equals
*/
public function testEqualsEmptyItems() { /** @var \Drupal\Core\Field\FieldItemBase $fv */
$first_field_item =
$this->
getMockForAbstractClass('Drupal\Core\Field\FieldItemBase',
[], '', FALSE
);
$first_field_item->
setValue(['0' => 1, '1' => 2
]);
$second_field_item =
$this->
getMockForAbstractClass('Drupal\Core\Field\FieldItemBase',
[], '', FALSE
);
$second_field_item->
setValue(['1' => 2, '0' => 1
]);