function FieldableEntityDefinitionUpdateTest::assertBackupTables

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

@internal

File

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

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));
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.