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. 10 core/tests/Drupal/KernelTests/Core/Entity/FieldableEntityDefinitionUpdateTest.php \Drupal\KernelTests\Core\Entity\FieldableEntityDefinitionUpdateTest::assertBackupTables()
  3. 11.x 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));
    }
}

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