countRevisions example

$revisionId = $entity->getRevisionId();

    if ($entity instanceof RevisionLogInterface) {
      $entity->setRevisionCreationTime($date->modify('+1 hour')->getTimestamp());
    }
    $entity->setNewRevision();
    $entity->save();

    $revision = $storage->loadRevision($revisionId);
    $this->drupalGet($revision->toUrl('revision-revert-form'));

    $count = $this->countRevisions($entityTypeId);
    $this->submitForm([], 'Revert');

    // A new revision was created.     $this->assertEquals($count + 1, $this->countRevisions($entityTypeId));

    // Destination.     $this->assertSession()->statusCodeEquals(200);
    $this->assertSession()->addressEquals($expectedDestination);

    // Logger log.     $logs = $this->getLogs($entity->getEntityType()->getProvider());
    
Home | Imprint | This part of the site doesn't use cookies.