You are here

protected function SchedulerRevisioningTest::assertRevisionCount in Scheduler 8

Same name and namespace in other branches
  1. 2.x tests/src/Functional/SchedulerRevisioningTest.php \Drupal\Tests\scheduler\Functional\SchedulerRevisioningTest::assertRevisionCount()

Check if the number of revisions for a node matches a given value.

Parameters

int $nid: The node id of the node to check.

string $value: The value with which the number of revisions will be compared.

string $message: The message to display along with the assertion.

1 call to SchedulerRevisioningTest::assertRevisionCount()
SchedulerRevisioningTest::testRevisioning in tests/src/Functional/SchedulerRevisioningTest.php
Tests the creation of new revisions on scheduling.

File

tests/src/Functional/SchedulerRevisioningTest.php, line 46

Class

SchedulerRevisioningTest
Tests revision options when Scheduler publishes or unpublishes content.

Namespace

Drupal\Tests\scheduler\Functional

Code

protected function assertRevisionCount($nid, $value, $message = '') {

  // Because we are not deleting any revisions we can take a short cut and use
  // getLatestRevisionId() which will effectively be the number of revisions.
  $count = $this->nodeStorage
    ->getLatestRevisionId($nid);
  $this
    ->assertEquals($value, (int) $count, $message);
}