function ContentModerationSyncingTest::testNoRevisionForcedDuringSync

Same name in other branches
  1. 9 core/modules/content_moderation/tests/src/Kernel/ContentModerationSyncingTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationSyncingTest::testNoRevisionForcedDuringSync()
  2. 8.9.x core/modules/content_moderation/tests/src/Kernel/ContentModerationSyncingTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationSyncingTest::testNoRevisionForcedDuringSync()
  3. 10 core/modules/content_moderation/tests/src/Kernel/ContentModerationSyncingTest.php \Drupal\Tests\content_moderation\Kernel\ContentModerationSyncingTest::testNoRevisionForcedDuringSync()

Tests no new revision is forced during a sync.

File

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

Class

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

Namespace

Drupal\Tests\content_moderation\Kernel

Code

public function testNoRevisionForcedDuringSync() : void {
    $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);
}

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