You are here

protected function MigrateNodeTest::assertRevision in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeTest::assertRevision()
  2. 10 core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeTest::assertRevision()

Asserts various aspects of a node revision.

Parameters

int $id: The revision ID.

string $title: The expected title.

int $uid: The revision author ID.

string $log: The revision log message.

int $timestamp: The revision's time stamp.

1 call to MigrateNodeTest::assertRevision()
MigrateNodeTest::testNode in core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php
Tests node migration from Drupal 7 to 8.

File

core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTest.php, line 137

Class

MigrateNodeTest
Tests node migration.

Namespace

Drupal\Tests\node\Kernel\Migrate\d7

Code

protected function assertRevision($id, $title, $uid, $log, $timestamp) {
  $revision = \Drupal::entityTypeManager()
    ->getStorage('node')
    ->loadRevision($id);
  $this
    ->assertInstanceOf(NodeInterface::class, $revision);
  $this
    ->assertEquals($title, $revision
    ->getTitle());
  $this
    ->assertEquals($uid, $revision
    ->getRevisionUser()
    ->id());
  $this
    ->assertEquals($log, $revision->revision_log->value);
  $this
    ->assertEquals($timestamp, $revision
    ->getRevisionCreationTime());
}