function EntityTypeInfoTest::enableModeration

Same name and namespace in other branches
  1. 8.9.x core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php \Drupal\Tests\content_moderation\Kernel\EntityTypeInfoTest::enableModeration()
  2. 10 core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php \Drupal\Tests\content_moderation\Kernel\EntityTypeInfoTest::enableModeration()
  3. 11.x core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php \Drupal\Tests\content_moderation\Kernel\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
@covers ::entityBaseFieldInfo
EntityTypeInfoTest::testEntityBaseFieldInfo in core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php
@covers ::entityBaseFieldInfo
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 145

Class

EntityTypeInfoTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21content_moderation%21src%21EntityTypeInfo.php/class/EntityTypeInfo/9" title="Manipulates entity type information." class="local">\Drupal\content_moderation\EntityTypeInfo</a>

Namespace

Drupal\Tests\content_moderation\Kernel

Code

protected function enableModeration($entity_type_id, $bundle) {
    $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.