public function testDescriptionRevLog(): void
{ /** @var \Drupal\entity_test_revlog\Entity\EntityTestWithRevisionLog $entity */
$entity = EntityTestWithRevisionLog::
create(['type' => 'entity_test_revlog'
]);
$entity->
setName('view all revisions'
);
$user =
$this->
drupalCreateUser([],
$this->
randomMachineName());
$entity->
setRevisionUser($user);
$entity->
setRevisionCreationTime((new \
DateTime('2 February 2013 4:00:00pm'
))->
getTimestamp());
$entity->
save();
$this->
drupalGet($entity->
toUrl('version-history'
));
$this->
assertSession()->
elementTextContains('css', 'table tbody tr:nth-child(1)', '02/02/2013 - 16:00'
);
$this->
assertSession()->
elementTextContains('css', 'table tbody tr:nth-child(1)',
$user->
getAccountName());
} /**
* Test description with entity implementing revision log, with empty values.
*
* @covers ::getRevisionDescription
*/
public function testDescriptionRevLogNullValues(): void
{ $entity = EntityTestWithRevisionLog::
create(['type' => 'entity_test_revlog'
]);
$entity->
setName('view all revisions'
)->
save();