function MigrateNodeRevisionTest::assertRevision

Same name in this branch
  1. 10 core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeRevisionTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeRevisionTest::assertRevision()
Same name in other branches
  1. 9 core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeRevisionTest.php \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeRevisionTest::assertRevision()
  2. 9 core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeRevisionTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeRevisionTest::assertRevision()
  3. 8.9.x core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeRevisionTest.php \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeRevisionTest::assertRevision()
  4. 8.9.x core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeRevisionTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeRevisionTest::assertRevision()
  5. 11.x core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeRevisionTest.php \Drupal\Tests\node\Kernel\Migrate\d6\MigrateNodeRevisionTest::assertRevision()
  6. 11.x core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeRevisionTest.php \Drupal\Tests\node\Kernel\Migrate\d7\MigrateNodeRevisionTest::assertRevision()

Asserts various aspects of a node revision.

@internal

Parameters

int $id: The revision ID.

string $langcode: The revision language.

string $title: The expected title.

string|null $log: The revision log message.

int $timestamp: The revision's time stamp.

1 call to MigrateNodeRevisionTest::assertRevision()
MigrateNodeRevisionTest::testNodeRevision in core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeRevisionTest.php
Tests node revisions migration from Drupal 6 to 8.

File

core/modules/node/tests/src/Kernel/Migrate/d6/MigrateNodeRevisionTest.php, line 54

Class

MigrateNodeRevisionTest
Node content revisions migration.

Namespace

Drupal\Tests\node\Kernel\Migrate\d6

Code

protected function assertRevision(int $id, string $langcode, string $title, ?string $log, int $timestamp) : void {
    
    /** @var  \Drupal\node\NodeInterface $revision */
    $revision = $this->nodeStorage
        ->loadRevision($id)
        ->getTranslation($langcode);
    $this->assertInstanceOf(NodeInterface::class, $revision);
    $this->assertSame($title, $revision->getTitle());
    $this->assertSame($log, $revision->revision_log->value);
    $this->assertSame($timestamp, (int) $revision->getRevisionCreationTime());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.