function EntityTypeInfoTest::testEntityTypeAlter

Same name in other branches
  1. 9 core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php \Drupal\Tests\content_moderation\Kernel\EntityTypeInfoTest::testEntityTypeAlter()
  2. 10 core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php \Drupal\Tests\content_moderation\Kernel\EntityTypeInfoTest::testEntityTypeAlter()
  3. 11.x core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php \Drupal\Tests\content_moderation\Kernel\EntityTypeInfoTest::testEntityTypeAlter()

Test the correct entity types have moderation added.

@covers ::entityTypeAlter

@dataProvider providerTestEntityTypeAlter

File

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

Class

EntityTypeInfoTest
@coversDefaultClass \Drupal\content_moderation\EntityTypeInfo

Namespace

Drupal\Tests\content_moderation\Kernel

Code

public function testEntityTypeAlter($entity_type_id, $moderatable) {
    $entity_types = $this->entityTypeManager
        ->getDefinitions();
    $this->assertSame($moderatable, $entity_types[$entity_type_id]->hasHandlerClass('moderation'));
}

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