public function ContentModerationSyncingTest::testNoRevisionForcedDuringSync in Drupal 9
Same name and namespace in other branches
- 8 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 45
Class
- ContentModerationSyncingTest
- Test content moderation when an entity is marked as 'syncing'.
Namespace
Drupal\Tests\content_moderation\KernelCode
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);
}