function EntityTypeInfoTest::testEntityBaseFieldInfo
Same name in other branches
- 9 core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php \Drupal\Tests\content_moderation\Kernel\EntityTypeInfoTest::testEntityBaseFieldInfo()
- 10 core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php \Drupal\Tests\content_moderation\Kernel\EntityTypeInfoTest::testEntityBaseFieldInfo()
- 11.x core/modules/content_moderation/tests/src/Kernel/EntityTypeInfoTest.php \Drupal\Tests\content_moderation\Kernel\EntityTypeInfoTest::testEntityBaseFieldInfo()
@covers ::entityBaseFieldInfo
File
-
core/
modules/ content_moderation/ tests/ src/ Kernel/ EntityTypeInfoTest.php, line 68
Class
- EntityTypeInfoTest
- @coversDefaultClass \Drupal\content_moderation\EntityTypeInfo
Namespace
Drupal\Tests\content_moderation\KernelCode
public function testEntityBaseFieldInfo() {
$definition = $this->entityTypeManager
->getDefinition('entity_test');
$definition->setHandlerClass('moderation', ModerationHandler::class);
$this->enableModeration('entity_test', 'entity_test');
$base_fields = $this->entityTypeInfo
->entityBaseFieldInfo($definition);
$this->assertFalse($base_fields['moderation_state']->isReadOnly());
$this->assertTrue($base_fields['moderation_state']->isComputed());
$this->assertTrue($base_fields['moderation_state']->isTranslatable());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.