protected function WorkspacesContentModerationStateTest::assertDefaultRevision in Drupal 10
Same name and namespace in other branches
- 8 core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php \Drupal\Tests\content_moderation\Kernel\WorkspacesContentModerationStateTest::assertDefaultRevision()
- 9 core/modules/content_moderation/tests/src/Kernel/WorkspacesContentModerationStateTest.php \Drupal\Tests\content_moderation\Kernel\WorkspacesContentModerationStateTest::assertDefaultRevision()
File
- core/
modules/ content_moderation/ tests/ src/ Kernel/ WorkspacesContentModerationStateTest.php, line 256
Class
- WorkspacesContentModerationStateTest
- Tests that Workspaces and Content Moderation work together properly.
Namespace
Drupal\Tests\content_moderation\KernelCode
protected function assertDefaultRevision(EntityInterface $entity, int $revision_id, $published = TRUE) : void {
// In the context of a workspace, the default revision ID is always the
// latest workspace-specific revision, so we need to adjust the expectation
// of the parent assertion.
$revision_id = $this->entityTypeManager
->getStorage($entity
->getEntityTypeId())
->load($entity
->id())
->getRevisionId();
// Additionally, the publishing status of the default revision is not
// relevant in a workspace, because getting an entity to a "published"
// moderation state doesn't automatically make it the default revision, so
// we have to disable that assertion.
$published = NULL;
parent::assertDefaultRevision($entity, $revision_id, $published);
}