function MigrateFieldInstanceLabelDescriptionTest::migrateDumpAlter

Allows tests to alter dumps after they have loaded.

Parameters

\Drupal\KernelTests\KernelTestBase $test: The test that is being run.

Overrides MigrateDumpAlterInterface::migrateDumpAlter

File

core/modules/field/tests/src/Kernel/Migrate/d7/MigrateFieldInstanceLabelDescriptionTest.php, line 67

Class

MigrateFieldInstanceLabelDescriptionTest
Tests migration field label and description i18n translations.

Namespace

Drupal\Tests\field\Kernel\Migrate\d7

Code

public static function migrateDumpAlter(KernelTestBase $test) {
  $db = Database::getConnection('default', 'migrate');
  // Alter the database to test the migration is successful when a translated
  // field is deleted but the translation data for that field remains in both
  // the i18n_strings and locales_target tables.
  $db->delete('field_config_instance')
    ->condition('field_name', 'field_image')
    ->condition('bundle', 'article')
    ->execute();
}

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