Commit d2404bee authored by webchick's avatar webchick

Issue #2550823 by phenaproxima, neclimdul: Migrate Drupal integration tests...

Issue #2550823 by phenaproxima, neclimdul: Migrate Drupal integration tests should load all dump files
parent d6002691
......@@ -31,7 +31,6 @@ class MigrateActionConfigsTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['Variable.php']);
$this->executeMigration('d6_action_settings');
}
......
......@@ -31,7 +31,6 @@ class MigrateAggregatorConfigsTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['Variable.php']);
$this->executeMigration('d6_aggregator_settings');
}
......
......@@ -25,7 +25,6 @@ class MigrateAggregatorFeedTest extends MigrateDrupal6TestBase {
protected function setUp() {
parent::setUp();
$this->installEntitySchema('aggregator_feed');
$this->loadDumps(['AggregatorFeed.php']);
$this->executeMigration('d6_aggregator_feed');
}
......
......@@ -45,7 +45,6 @@ protected function setUp() {
));
$entity->enforceIsNew();
$entity->save();
$this->loadDumps(['AggregatorItem.php']);
$this->executeMigration('d6_aggregator_item');
}
......
......@@ -24,7 +24,6 @@ class MigrateAggregatorSettingsTest extends MigrateDrupal7TestBase {
protected function setUp() {
parent::setUp();
$this->installConfig(static::$modules);
$this->loadDumps(['Variable.php']);
$this->executeMigration('d7_aggregator_settings');
}
......
......@@ -32,7 +32,6 @@ class MigrateBlockedIPsTest extends MigrateDrupal7TestBase {
protected function setUp() {
parent::setUp();
$this->installSchema('ban', ['ban_ip']);
$this->loadDumps(['BlockedIps.php']);
$this->executeMigration('d7_blocked_ips');
}
......
......@@ -71,7 +71,6 @@ protected function setUp() {
// Install one of D8's test themes.
\Drupal::service('theme_handler')->install(array('test_theme'));
$this->loadDumps(['Blocks.php', 'BlocksRoles.php', 'AggregatorFeed.php']);
$this->executeMigration('d6_block');
}
......
......@@ -35,7 +35,6 @@ protected function setUp() {
array(array(2), array('full_html'))
)
));
$this->loadDumps(['Boxes.php']);
$this->executeMigration('d6_custom_block');
}
......
......@@ -31,7 +31,6 @@ class MigrateBookConfigsTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['Variable.php']);
$this->executeMigration('d6_book_settings');
}
......
......@@ -42,8 +42,6 @@ protected function setUp() {
$id_mappings['d6_node'][] = array(array($i), array($i));
}
$this->prepareMigrations($id_mappings);
// Load database dumps to provide source data.
$this->loadDumps(['Book.php', 'MenuLinks.php']);
$this->executeMigration('d6_book');
}
......
......@@ -56,16 +56,6 @@ protected function setUp() {
'd6_comment_entity_form_display' => array(array(array('story'), array('node', 'story', 'default', 'comment'))),
);
$this->prepareMigrations($id_mappings);
$this->loadDumps([
'Node.php',
'NodeRevisions.php',
'ContentTypeStory.php',
'ContentTypeTestPlanet.php',
'Variable.php',
'NodeType.php',
'Comments.php',
]);
$this->executeMigration('d6_comment');
}
......
......@@ -24,12 +24,9 @@ class MigrateCommentTypeTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->installEntitySchema('node');
$this->installEntitySchema('comment');
$this->installConfig(['node', 'comment']);
$this->loadDumps(['Variable.php', 'NodeType.php']);
$this->executeMigration('d6_comment_type');
}
......
......@@ -64,7 +64,6 @@ protected function setUp() {
),
);
$this->prepareMigrations($id_mappings);
$this->loadDumps(['Variable.php', 'NodeType.php']);
$this->executeMigration(static::MIGRATION);
}
......
......@@ -42,7 +42,6 @@ protected function setUp() {
),
);
$this->prepareMigrations($id_mappings);
$this->loadDumps(['Variable.php', 'NodeType.php']);
$this->executeMigration('d6_comment_entity_form_display_subject');
}
......
......@@ -41,7 +41,6 @@ protected function setUp() {
),
);
$this->prepareMigrations($id_mappings);
$this->loadDumps(['Variable.php', 'NodeType.php']);
$this->executeMigration('d6_comment_field');
}
......
......@@ -49,7 +49,6 @@ protected function setUp() {
'type' => 'comment',
'translatable' => '0',
))->save();
$this->loadDumps(['Variable.php', 'NodeType.php']);
$this->executeMigration('d6_comment_field_instance');
}
......
......@@ -29,7 +29,6 @@ class MigrateContactCategoryTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['Contact.php']);
$this->executeMigration('d6_contact_category');
}
......
......@@ -39,7 +39,6 @@ protected function setUp() {
),
);
$this->prepareMigrations($id_mappings);
$this->loadDumps(['Variable.php', 'Contact.php']);
$this->executeMigration('d6_contact_settings');
}
......
......@@ -31,7 +31,6 @@ class MigrateDblogConfigsTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['Variable.php']);
$this->executeMigration('d6_dblog_settings');
}
......
......@@ -29,7 +29,6 @@ class MigrateDblogConfigsTest extends MigrateDrupal7TestBase {
protected function setUp() {
parent::setUp();
$this->installConfig(static::$modules);
$this->loadDumps(['Variable.php']);
$this->executeMigration('d7_dblog_settings');
}
......
......@@ -64,14 +64,6 @@ protected function setUp() {
),
);
$this->prepareMigrations($id_mappings);
$this->loadDumps([
'ContentNodeFieldInstance.php',
'ContentNodeField.php',
'ContentFieldTest.php',
'ContentFieldTestTwo.php',
'ContentFieldMultivalue.php',
]);
$this->executeMigration('d6_field_formatter_settings');
}
......
......@@ -66,13 +66,6 @@ protected function setUp() {
entity_create('node_type', array('type' => 'story'))->save();
entity_create('node_type', array('type' => 'test_page'))->save();
$this->loadDumps([
'ContentNodeFieldInstance.php',
'ContentNodeField.php',
'ContentFieldTest.php',
'ContentFieldTestTwo.php',
'ContentFieldMultivalue.php',
]);
$this->createFields();
$this->executeMigration('d6_field_instance');
}
......
......@@ -29,13 +29,6 @@ class MigrateFieldTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps([
'ContentNodeFieldInstance.php',
'ContentNodeField.php',
'ContentFieldTest.php',
'ContentFieldTestTwo.php',
'ContentFieldMultivalue.php',
]);
$this->executeMigration('d6_field');
}
......
......@@ -61,13 +61,6 @@ protected function setUp() {
),
);
$this->prepareMigrations($id_mappings);
$this->loadDumps([
'ContentNodeFieldInstance.php',
'ContentNodeField.php',
'ContentFieldTest.php',
'ContentFieldTestTwo.php',
'ContentFieldMultivalue.php',
]);
$this->executeMigration('d6_field_instance_widget_settings');
}
......
......@@ -31,7 +31,6 @@ class MigrateFileConfigsTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['Variable.php']);
$this->executeMigration('d6_file_settings');
}
......
......@@ -44,7 +44,6 @@ protected function setUp() {
$this->installEntitySchema('file');
$this->installConfig(['file']);
$this->loadDumps(['Files.php']);
/** @var \Drupal\migrate\Entity\MigrationInterface $migration */
$migration = entity_load('migration', 'd6_file');
$source = $migration->get('source');
......@@ -74,8 +73,6 @@ public function testFiles() {
// Test that we can re-import and also test with file_directory_path set.
db_truncate(entity_load('migration', 'd6_file')->getIdMap()->mapTableName())->execute();
$this->loadDumps(['Variable.php']);
// Update the file_directory_path.
Database::getConnection('default', 'migrate')
->update('variable')
......
......@@ -94,13 +94,6 @@ protected function setUp() {
$node->save();
}
}
$this->loadDumps([
'Node.php',
'NodeRevisions.php',
'ContentTypeStory.php',
'ContentTypeTestPlanet.php',
'Upload.php',
]);
}
}
......@@ -39,8 +39,6 @@ protected function setUp() {
),
);
$this->prepareMigrations($id_mappings);
$this->loadDumps(['NodeType.php', 'Variable.php']);
$this->executeMigration('d6_upload_entity_display');
}
......
......@@ -39,8 +39,6 @@ protected function setUp() {
),
);
$this->prepareMigrations($id_mappings);
$this->loadDumps(['NodeType.php', 'Variable.php']);
$this->executeMigration('d6_upload_entity_form_display');
}
......
......@@ -51,7 +51,6 @@ protected function setUp() {
'translatable' => '0',
))->save();
$this->loadDumps(['NodeType.php', 'Variable.php']);
$this->executeMigration('d6_upload_field_instance');
}
......
......@@ -26,7 +26,6 @@ class MigrateFileTest extends MigrateDrupal7TestBase {
protected function setUp() {
parent::setUp();
$this->loadDumps(['FileManaged.php', 'Variable.php']);
$this->installEntitySchema('file');
$fs = \Drupal::service('file_system');
......
......@@ -26,7 +26,6 @@ class MigrateFilterFormatTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['Filters.php', 'FilterFormats.php', 'Variable.php']);
$this->executeMigration('d6_filter_format');
}
......
......@@ -28,7 +28,6 @@ class MigrateFilterFormatTest extends MigrateDrupal7TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['Filter.php', 'FilterFormat.php', 'Variable.php']);
$this->executeMigration('d7_filter_format');
}
......
......@@ -36,7 +36,6 @@ protected function setUp() {
array(array(1), array('vocabulary_1_i_0_')),
)
));
$this->loadDumps(['Variable.php']);
$this->executeMigration('d6_forum_settings');
}
......
......@@ -31,7 +31,6 @@ class MigrateLocaleConfigsTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['Variable.php']);
$this->executeMigration('locale_settings');
}
......
......@@ -42,7 +42,6 @@ protected function setUp() {
),
));
$this->loadDumps(['MenuLinks.php']);
$this->executeMigration('d6_menu_links');
}
......
......@@ -24,7 +24,6 @@ class MigrateMenuSettingsTest extends MigrateDrupal7TestBase {
protected function setUp() {
parent::setUp();
$this->installConfig(['menu_ui']);
$this->loadDumps(['Variable.php']);
$this->executeMigration('menu_settings');
}
......
......@@ -30,7 +30,8 @@ abstract class MigrateDrupalTestBase extends MigrateTestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['System.php']);
$tables = file_scan_directory($this->getDumpDirectory(), '/.php$/', array('recurse' => FALSE));
$this->loadDumps(array_keys($tables));
$this->installEntitySchema('user');
$this->installConfig(['migrate_drupal', 'system']);
......@@ -46,14 +47,6 @@ protected function getDumpDirectory() {
return __DIR__ . '/Table';
}
/**
* {@inheritdoc}
*/
protected function loadDumps(array $files, $method = 'load') {
$files = array_map(function($file) { return $this->getDumpDirectory() . '/' . $file; }, $files);
parent::loadDumps($files, $method);
}
/**
* Turn all the migration templates for the specified drupal version into
* real migration entities so we can test them.
......
......@@ -28,14 +28,6 @@ abstract class MigrateFullDrupalTestBase extends MigrateDrupalTestBase {
*/
protected static $blacklist = [];
/**
* Get the dump classes required for this migration test.
*
* @return array
* The list of files containing dumps.
*/
protected abstract function getDumps();
/**
* Get the test classes that needs to be run for this test.
*
......@@ -73,14 +65,10 @@ protected function tearDown() {
parent::tearDown();
}
/**
* Test the complete Drupal migration.
*/
public function testDrupal() {
$dumps = $this->getDumps();
$this->loadDumps($dumps);
$classes = $this->getTestClassesList();
foreach ($classes as $class) {
if (is_subclass_of($class, '\Drupal\migrate\Tests\MigrateDumpAlterInterface')) {
......
......@@ -208,52 +208,6 @@ protected function setUp() {
$this->installMigrations('Drupal 6');
}
/**
* {@inheritdoc}
*/
protected function getDumps() {
return array(
'AggregatorFeed.php',
'AggregatorItem.php',
'Blocks.php',
'BlocksRoles.php',
'Book.php',
'Boxes.php',
'Comments.php',
'Contact.php',
'ContentFieldMultivalue.php',
'ContentFieldTest.php',
'ContentFieldTestTwo.php',
'ContentNodeField.php',
'ContentNodeFieldInstance.php',
'ContentTypeStory.php',
'ContentTypeTestPlanet.php',
'EventTimezones.php',
'Files.php',
'FilterFormats.php',
'Filters.php',
'MenuCustom.php',
'MenuLinks.php',
'Node.php',
'NodeRevisions.php',
'NodeType.php',
'Permission.php',
'ProfileFields.php',
'ProfileValues.php',
'Role.php',
'TermData.php',
'TermHierarchy.php',
'TermNode.php',
'Upload.php',
'UrlAlias.php',
'Users.php',
'UsersRoles.php',
'Variable.php',
'Vocabulary.php',
'VocabularyNodeTypes.php',
);
}
/**
* Returns the path to the dump directory.
*
......
......@@ -55,7 +55,6 @@ public function testMigrateDependenciesOrder() {
public function testAggregatorMigrateDependencies() {
/** @var \Drupal\migrate\entity\Migration $migration */
$migration = entity_load('migration', 'd6_aggregator_item');
$this->loadDumps(['AggregatorItem.php']);
$executable = new MigrateExecutable($migration, $this);
$this->startCollectingMessages();
$executable->import();
......
......@@ -16,18 +16,6 @@ class MigrateNodeBuilderTest extends MigrateDrupal6TestBase {
public static $modules = ['migrate', 'migrate_drupal', 'node'];
/**
* {@inheritdoc}
*/
public function setUp() {
parent::setUp();
$this->loadDumps([
'ContentNodeField.php',
'ContentNodeFieldInstance.php',
'NodeType.php',
]);
}
/**
* Tests creating migrations from a template, using a builder plugin.
*/
......
......@@ -57,7 +57,6 @@ public function setUp() {
);
$this->prepareMigrations($id_mappings);
$this->loadDumps(['NodeType.php', 'Variable.php']);
$this->executeMigration('d6_node_setting_promote');
$this->executeMigration('d6_node_setting_status');
$this->executeMigration('d6_node_setting_sticky');
......
......@@ -31,7 +31,6 @@ class MigrateNodeConfigsTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['Variable.php']);
$this->executeMigration('d6_node_settings');
}
......
......@@ -29,8 +29,6 @@ protected function setUp() {
);
$this->prepareMigrations($id_mappings);
$this->loadDumps(['Users.php']);
// Create our users for the node authors.
$query = Database::getConnection('default', 'migrate')->query('SELECT * FROM {users} WHERE uid NOT IN (0, 1)');
while(($row = $query->fetchAssoc()) !== FALSE) {
......
......@@ -94,20 +94,6 @@ protected function setUp() {
));
$node->enforceIsNew();
$node->save();
$this->loadDumps([
'Node.php',
'NodeRevisions.php',
'ContentTypeStory.php',
'ContentTypeTestPlanet.php',
'NodeType.php',
'Variable.php',
'ContentNodeFieldInstance.php',
'ContentNodeField.php',
'ContentFieldTest.php',
'ContentFieldTestTwo.php',
'ContentFieldMultivalue.php',
]);
}
}
......@@ -30,9 +30,7 @@ class MigrateNodeTypeTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->installConfig(array('node'));
$this->loadDumps(['NodeType.php', 'Variable.php']);
$this->executeMigration('d6_node_type');
}
......
......@@ -29,13 +29,6 @@ class MigrateViewModesTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps([
'ContentNodeFieldInstance.php',
'ContentNodeField.php',
'ContentFieldTest.php',
'ContentFieldTestTwo.php',
'ContentFieldMultivalue.php',
]);
$this->executeMigration('d6_view_modes');
}
......
......@@ -31,9 +31,7 @@ class MigrateUrlAliasTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->installSchema('system', ['url_alias']);
$this->loadDumps(['UrlAlias.php']);
$this->executeMigration('d6_url_alias');
}
......
......@@ -30,7 +30,6 @@ class MigrateSearchPageTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['Variable.php']);
$this->executeMigration('d6_search_page');
}
......
......@@ -31,7 +31,6 @@ class MigrateSearchSettingsTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['Variable.php']);
$this->executeMigration('d6_search_settings');
}
......
......@@ -23,7 +23,6 @@ class MigrateSearchSettingsTest extends MigrateDrupal7TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['Variable.php']);
$this->executeMigration('d7_search_settings');
}
......
......@@ -33,7 +33,6 @@ protected function setUp() {
parent::setUp();
$this->installConfig(['simpletest']);
$this->loadDumps(['Variable.php']);
$this->executeMigration('d6_simpletest_settings');
}
......
......@@ -24,7 +24,6 @@ class MigrateSimpletestSettingsTest extends MigrateDrupal7TestBase {
protected function setUp() {
parent::setUp();
$this->installConfig(static::$modules);
$this->loadDumps(['Variable.php']);
$this->executeMigration('d7_simpletest_settings');
}
......
......@@ -31,7 +31,6 @@ class MigrateStatisticsConfigsTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['Variable.php']);
$this->executeMigration('d6_statistics_settings');
}
......
......@@ -31,7 +31,6 @@ class MigrateSyslogConfigsTest extends MigrateDrupal6TestBase {
*/
protected function setUp() {
parent::setUp();
$this->loadDumps(['Variable.php']);
$this->executeMigration('d6_syslog_settings');
}
......
......@@ -32,7 +32,6 @@ class MigrateSyslogConfigsTest extends MigrateDrupal7TestBase {
protected function