function ModerationInformationTest::testShouldModerateEntities

Same name in other branches
  1. 8.9.x core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php \Drupal\Tests\content_moderation\Unit\ModerationInformationTest::testShouldModerateEntities()
  2. 10 core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php \Drupal\Tests\content_moderation\Unit\ModerationInformationTest::testShouldModerateEntities()
  3. 11.x core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php \Drupal\Tests\content_moderation\Unit\ModerationInformationTest::testShouldModerateEntities()

@dataProvider providerWorkflow @covers ::shouldModerateEntitiesOfBundle

File

core/modules/content_moderation/tests/src/Unit/ModerationInformationTest.php, line 132

Class

ModerationInformationTest
@coversDefaultClass \Drupal\content_moderation\ModerationInformation @group content_moderation

Namespace

Drupal\Tests\content_moderation\Unit

Code

public function testShouldModerateEntities($workflow, $expected) {
    $entity_type = new ContentEntityType([
        'id' => 'test_entity_type',
        'bundle_entity_type' => 'entity_test_bundle',
        'handlers' => [
            'moderation' => ModerationHandler::class,
        ],
    ]);
    $moderation_information = new ModerationInformation($this->getEntityTypeManager(), $this->setupModerationBundleInfo('test_bundle', $workflow));
    $this->assertEquals($expected, $moderation_information->shouldModerateEntitiesOfBundle($entity_type, 'test_bundle'));
}

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