You are here

protected function FieldableEntityDefinitionUpdateTest::assertBackupTables in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php \Drupal\KernelTests\Core\Entity\FieldableEntityDefinitionUpdateTest::assertBackupTables()
  2. 9 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.

@internal

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 655

Class

FieldableEntityDefinitionUpdateTest
Tests EntityDefinitionUpdateManager's fieldable entity update functionality.

Namespace

Drupal\KernelTests\Core\Entity

Code

protected function assertBackupTables() : void {
  $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));
  }
}