You are here

public function NodeRevisionGenerateTest::addRevision in Node Revision Delete 8

Adds a revision to a node.

Parameters

\Drupal\node\Entity\Node $node: Node.

int $timestamp: The revision creation date.

Throws

\Drupal\Core\Entity\EntityStorageException

1 call to NodeRevisionGenerateTest::addRevision()
NodeRevisionGenerateTest::testGenerationForm in modules/node_revision_generate/tests/src/Functional/NodeRevisionGenerateTest.php
Tests the form, the permission and the link.

File

modules/node_revision_generate/tests/src/Functional/NodeRevisionGenerateTest.php, line 87

Class

NodeRevisionGenerateTest
Test the node_revision_generate_generate_revisions form.

Namespace

Drupal\Tests\node_revision_generate\Functional

Code

public function addRevision(Node &$node, $timestamp) {
  $node
    ->setNewRevision();
  $node
    ->setRevisionCreationTime($timestamp);
  $node
    ->save();
}