function EntityTypeInfoTest::enableModeration

Add moderation to an entity type and bundle.

3 calls to EntityTypeInfoTest::enableModeration()
EntityTypeInfoTest::testBaseFieldOnlyAddedToModeratedEntityTypes in core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php
Tests base field only added to moderated entity types.
EntityTypeInfoTest::testEntityBaseFieldInfo in core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php
Tests entity base field info.
EntityTypeInfoTest::testEntityBaseFieldProvider in core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php
Tests entity base field provider.

File

core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php, line 154

Class

EntityTypeInfoTest
Tests Drupal\content_moderation\EntityTypeInfo.

Namespace

Drupal\Tests\content_moderation\Kernel

Code

protected function enableModeration($entity_type_id, $bundle) : void {
  $workflow = $this->createEditorialWorkflow();
  $workflow->getTypePlugin()
    ->addEntityTypeAndBundle($entity_type_id, $bundle);
  $workflow->save();
}

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