$this->fieldDefinitions =
[ 'id' => BaseFieldDefinition::
create('integer'
),
'revision_id' => BaseFieldDefinition::
create('integer'
),
];
$this->entityFieldManager->
expects($this->
any()) ->
method('getFieldDefinitions'
) ->
with($this->entityTypeId,
$this->bundle
) ->
willReturn($this->fieldDefinitions
);
$this->entity =
$this->
getMockForAbstractClass(ContentEntityBase::
class,
[$values,
$this->entityTypeId,
$this->bundle
], '', TRUE, TRUE, TRUE,
['isNew'
]);
$values['defaultLangcode'
] =
[LanguageInterface::LANGCODE_DEFAULT => LanguageInterface::LANGCODE_NOT_SPECIFIED
];
$this->entityUnd =
$this->
getMockForAbstractClass(ContentEntityBase::
class,
[$values,
$this->entityTypeId,
$this->bundle
]);
} /**
* @covers ::isNewRevision
* @covers ::setNewRevision
*/
public function testIsNewRevision() { // Set up the entity type so that on the first call there is no revision key
// and on the second call there is one.