public function MigrateUpgradeCommandsTest::testDrupalConfigureUpgrade in Migrate Upgrade 8.3
Test module using Drupal fixture.
@dataProvider majorDrupalVersionsDataProvider
Parameters
int $drupal_version: The major Drupal version.
File
- tests/
src/ Functional/ MigrateUpgradeCommandsTest.php, line 47
Class
- MigrateUpgradeCommandsTest
- Execute drush on fully functional website.
Namespace
Drupal\Tests\migrate_upgrade\FunctionalCode
public function testDrupalConfigureUpgrade($drupal_version) : void {
$this
->loadFixture(drupal_get_path('module', 'migrate_drupal') . "/tests/fixtures/drupal{$drupal_version}.php");
$prefix = 'upgrade_legacy_';
$this
->executeMigrateUpgrade([
'configure-only' => NULL,
'migration-prefix' => $prefix,
]);
$expected = [
"{$prefix}action_settings" => [
'original' => 'action_settings',
'generated' => "{$prefix}action_settings",
],
"{$prefix}book_settings" => [
'original' => 'book_settings',
'generated' => "{$prefix}book_settings",
],
];
// Replacement for assertArraySubset that was deprecated.
$this
->assertEquals($this
->getOutputFromJSON(), array_replace_recursive($expected, $this
->getOutputFromJSON()));
$migrate_plus_migrations = Migration::loadMultiple();
$migrations = $this
->getMigrations($this->sourceDatabase
->getKey(), $drupal_version);
$this
->assertMigrations($prefix, $migrations, $migrate_plus_migrations);
$optional = array_flip($migrate_plus_migrations["{$prefix}d{$drupal_version}_url_alias"]
->toArray()['migration_dependencies']['optional']);
$node_migrations = array_intersect_key([
"{$prefix}d{$drupal_version}_node_translation_page" => TRUE,
"{$prefix}d{$drupal_version}_node_complete_page" => TRUE,
], $optional);
$this
->assertNotEmpty($node_migrations);
}