You are here

protected function FieldableEntityDefinitionUpdateTest::assertBackupTables in Drupal 8

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

Asserts that the backup tables have been kept after a successful update.

1 call to FieldableEntityDefinitionUpdateTest::assertBackupTables()
FieldableEntityDefinitionUpdateTest::testFieldableEntityTypeUpdates in core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php
@covers ::updateFieldableEntityType @dataProvider providerTestFieldableEntityTypeUpdates

File

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

Class

FieldableEntityDefinitionUpdateTest
Tests EntityDefinitionUpdateManager's fieldable entity update functionality.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function assertBackupTables() {
  $backups = \Drupal::keyValue('entity.update_backup')
    ->getAll();
  $backup = reset($backups);
  $schema = $this->database
    ->schema();
  foreach ($backup['table_mapping']
    ->getTableNames() as $table_name) {
    $this
      ->assertTrue($schema
      ->tableExists($table_name));
  }
}