You are here

protected function FieldableEntityDefinitionUpdateTest::assertNonRevisionableAndNonTranslatable in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php \Drupal\KernelTests\Core\Entity\FieldableEntityDefinitionUpdateTest::assertNonRevisionableAndNonTranslatable()
  2. 10 core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php \Drupal\KernelTests\Core\Entity\FieldableEntityDefinitionUpdateTest::assertNonRevisionableAndNonTranslatable()

Asserts that an entity type is neither revisionable nor translatable.

1 call to FieldableEntityDefinitionUpdateTest::assertNonRevisionableAndNonTranslatable()
FieldableEntityDefinitionUpdateTest::assertEntityTypeSchema in core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php
Asserts revisionable and/or translatable characteristics of an entity type.

File

core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php, line 603

Class

FieldableEntityDefinitionUpdateTest
Tests EntityDefinitionUpdateManager's fieldable entity update functionality.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function assertNonRevisionableAndNonTranslatable() {

  /** @var \Drupal\Core\Entity\ContentEntityTypeInterface $entity_type */
  $entity_type = $this->entityDefinitionUpdateManager
    ->getEntityType($this->entityTypeId);
  $this
    ->assertFalse($entity_type
    ->isRevisionable());
  $this
    ->assertFalse($entity_type
    ->isTranslatable());
  $database_schema = $this->database
    ->schema();
  $this
    ->assertTrue($database_schema
    ->tableExists($entity_type
    ->getBaseTable()));
  $this
    ->assertFalse($database_schema
    ->tableExists($entity_type
    ->getDataTable()));
  $this
    ->assertFalse($database_schema
    ->tableExists($entity_type
    ->getRevisionTable()));
  $this
    ->assertFalse($database_schema
    ->tableExists($entity_type
    ->getRevisionDataTable()));
}