You are here

public function ContentModerationSyncingTest::testNoRevisionForcedDuringSync in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/content_moderation/tests/src/Kernel/ContentModerationSyncingTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationSyncingTest::testNoRevisionForcedDuringSync()

Test no new revision is forced during a sync.

File

core/modules/content_moderation/tests/src/Kernel/ContentModerationSyncingTest.php, line 45

Class

ContentModerationSyncingTest
Test content moderation when an entity is marked as 'syncing'.

Namespace

Drupal\Tests\content_moderation\Kernel

Code

public function testNoRevisionForcedDuringSync() {
  $entity = EntityTestMulRevPub::create([
    'moderation_state' => 'draft',
    'name' => 'foo',
  ]);
  $entity
    ->save();
  $initial_revision_id = $entity
    ->getRevisionId();
  $entity
    ->setSyncing(TRUE);
  $entity->name = 'bar';
  $entity
    ->save();
  $this
    ->assertEquals($entity
    ->getRevisionId(), $initial_revision_id);
}