You are here

public function DateRecurOccurrenceTableSchemaTest::testRevisionableOccurrenceTableSchema in Recurring Dates Field 3.0.x

Same name and namespace in other branches
  1. 8.2 tests/src/Kernel/DateRecurOccurrenceTableSchemaTest.php \Drupal\Tests\date_recur\Kernel\DateRecurOccurrenceTableSchemaTest::testRevisionableOccurrenceTableSchema()
  2. 3.x tests/src/Kernel/DateRecurOccurrenceTableSchemaTest.php \Drupal\Tests\date_recur\Kernel\DateRecurOccurrenceTableSchemaTest::testRevisionableOccurrenceTableSchema()
  3. 3.1.x tests/src/Kernel/DateRecurOccurrenceTableSchemaTest.php \Drupal\Tests\date_recur\Kernel\DateRecurOccurrenceTableSchemaTest::testRevisionableOccurrenceTableSchema()

Tests occurrence table schema for revisionable entities.

File

tests/src/Kernel/DateRecurOccurrenceTableSchemaTest.php, line 65

Class

DateRecurOccurrenceTableSchemaTest
Tests occurrence tables schema.

Namespace

Drupal\Tests\date_recur\Kernel

Code

public function testRevisionableOccurrenceTableSchema() {
  $testEntityType = 'dr_entity_test_rev';
  $this
    ->installEntitySchema($testEntityType);

  // Check again this entity type is not revisionable.
  $definition = \Drupal::entityTypeManager()
    ->getDefinition($testEntityType);
  $this
    ->assertTrue($definition
    ->isRevisionable());
  $definitions = \Drupal::service('entity_field.manager')
    ->getFieldStorageDefinitions($testEntityType);
  $tableName = DateRecurOccurrences::getOccurrenceCacheStorageTableName($definitions[$this->fieldName]);
  $schema = \Drupal::database()
    ->schema();
  $this
    ->assertTrue($schema
    ->fieldExists($tableName, 'revision_id'));
}