Issue #3069541 by quietone, heddn: ValidateMigrationState should load test fixture
parent
50a700f950
commit
6e5a06e557
|
|
@ -29,12 +29,19 @@ not_finished:
|
|||
i18n: content_translation
|
||||
# Taxonomy term references.
|
||||
i18ntaxonomy: content_translation
|
||||
# Node revision translations.
|
||||
# https://www.drupal.org/project/drupal/issues/2746541
|
||||
node: content_translation
|
||||
7:
|
||||
# @TODO: Move to finished when remaining Drupal 7 i18n issues are resolved.
|
||||
# See https://www.drupal.org/project/drupal/issues/2208401
|
||||
i18n: content_translation
|
||||
# menu links.
|
||||
# Menu links.
|
||||
# See https://www.drupal.org/project/drupal/issues/3008028
|
||||
i18n_menu: content_translation
|
||||
# Migrate taxonomy term references
|
||||
# https://www.drupal.org/project/drupal/issues/3035392
|
||||
i18n_taxonomy: content_translation
|
||||
# Node revision translations.
|
||||
# https://www.drupal.org/project/drupal/issues/2746541
|
||||
node: content_translation
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\migrate_drupal\Kernel\d6;
|
||||
|
||||
use Drupal\Tests\migrate_drupal\Traits\ValidateMigrationStateTestTrait;
|
||||
|
||||
/**
|
||||
* Tests the migration state information in module.migrate_drupal.yml.
|
||||
*
|
||||
* @group migrate_drupal
|
||||
*/
|
||||
class ValidateMigrationStateTest extends MigrateDrupal6TestBase {
|
||||
|
||||
use ValidateMigrationStateTestTrait;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = [
|
||||
// Test migrations states.
|
||||
'migrate_state_finished_test',
|
||||
'migrate_state_not_finished_test',
|
||||
];
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\migrate_drupal\Kernel\d7;
|
||||
|
||||
use Drupal\Tests\migrate_drupal\Traits\ValidateMigrationStateTestTrait;
|
||||
|
||||
/**
|
||||
* Tests the migration state information in module.migrate_drupal.yml.
|
||||
*
|
||||
* @group migrate_drupal
|
||||
*/
|
||||
class ValidateMigrationStateTest extends MigrateDrupal7TestBase {
|
||||
|
||||
use ValidateMigrationStateTestTrait;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = [
|
||||
// Test migrations states.
|
||||
'migrate_state_finished_test',
|
||||
'migrate_state_not_finished_test',
|
||||
];
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\migrate_drupal\Kernel;
|
||||
namespace Drupal\Tests\migrate_drupal\Traits;
|
||||
|
||||
use Drupal\Component\Discovery\YamlDiscovery;
|
||||
use Drupal\KernelTests\FileSystemModuleDiscoveryDataProviderTrait;
|
||||
|
|
@ -15,24 +15,10 @@ use Drupal\migrate_drupal\MigrationState;
|
|||
*
|
||||
* @group migrate_drupal
|
||||
*/
|
||||
class ValidateMigrationStateTest extends MigrateDrupalTestBase {
|
||||
trait ValidateMigrationStateTestTrait {
|
||||
|
||||
use FileSystemModuleDiscoveryDataProviderTrait;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = [
|
||||
// Test migrations states.
|
||||
'migrate_state_finished_test',
|
||||
'migrate_state_not_finished_test',
|
||||
];
|
||||
|
||||
/**
|
||||
* Level separator of destination and source properties.
|
||||
*/
|
||||
const SEPARATOR = ',';
|
||||
|
||||
/**
|
||||
* Tests the migration information in .migrate_drupal.yml.
|
||||
*
|
||||
|
|
@ -43,6 +29,10 @@ class ValidateMigrationStateTest extends MigrateDrupalTestBase {
|
|||
* migrations are not needed.
|
||||
*/
|
||||
public function testMigrationState() {
|
||||
|
||||
// Level separator of destination and source properties.
|
||||
$separator = ',';
|
||||
|
||||
$this->enableAllModules();
|
||||
|
||||
// Build an array for each migration keyed by provider. The value is a
|
||||
|
|
@ -68,7 +58,7 @@ class ValidateMigrationStateTest extends MigrateDrupalTestBase {
|
|||
$destination_module = $migration->getDestinationPlugin()
|
||||
->getDestinationModule();
|
||||
|
||||
$discovered[$version][] = implode(static::SEPARATOR, [
|
||||
$discovered[$version][] = implode($separator, [
|
||||
$version,
|
||||
$provider,
|
||||
$source_module,
|
||||
|
|
@ -83,7 +73,7 @@ class ValidateMigrationStateTest extends MigrateDrupalTestBase {
|
|||
->getDefinitions();
|
||||
foreach ($definitions as $key => $definition) {
|
||||
foreach ($definition['core'] as $version) {
|
||||
$discovered[$version][] = implode(static::SEPARATOR, [
|
||||
$discovered[$version][] = implode($separator, [
|
||||
$version,
|
||||
$definition['provider'],
|
||||
$definition['source_module'],
|
||||
|
|
@ -114,7 +104,7 @@ class ValidateMigrationStateTest extends MigrateDrupalTestBase {
|
|||
if (($source !== 'i18nstrings') && ($source !== 'i18n_string')) {
|
||||
foreach ((array) $destination as $dest) {
|
||||
$key = [$info_version, $module, $source, trim($dest)];
|
||||
$declared[$info_version][$state][] = implode(static::SEPARATOR, $key);
|
||||
$declared[$info_version][$state][] = implode($separator, $key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -109,7 +109,6 @@ class MultilingualReviewPageTest extends MultilingualReviewPageTestBase {
|
|||
'jquery_ui',
|
||||
'link',
|
||||
'menu',
|
||||
'node',
|
||||
'nodeaccess',
|
||||
'nodereference',
|
||||
'number',
|
||||
|
|
@ -159,6 +158,7 @@ class MultilingualReviewPageTest extends MultilingualReviewPageTestBase {
|
|||
'i18nviews',
|
||||
'locale',
|
||||
'migrate_status_active_test',
|
||||
'node',
|
||||
'views',
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,7 +144,6 @@ class Upgrade6Test extends MigrateUpgradeExecuteTestBase {
|
|||
'imagecache',
|
||||
'imagefield',
|
||||
'menu',
|
||||
'node',
|
||||
'nodereference',
|
||||
'optionwidgets',
|
||||
'path',
|
||||
|
|
@ -180,6 +179,7 @@ class Upgrade6Test extends MigrateUpgradeExecuteTestBase {
|
|||
'i18nstrings',
|
||||
'i18ntaxonomy',
|
||||
'locale',
|
||||
'node',
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,6 @@ class MultilingualReviewPageTest extends MultilingualReviewPageTestBase {
|
|||
'list',
|
||||
'locale',
|
||||
'menu',
|
||||
'node',
|
||||
'number',
|
||||
'openid',
|
||||
'options',
|
||||
|
|
@ -169,6 +168,7 @@ class MultilingualReviewPageTest extends MultilingualReviewPageTestBase {
|
|||
'i18n_translation',
|
||||
'i18n_user',
|
||||
'i18n_variable',
|
||||
'node',
|
||||
'picture',
|
||||
'migrate_status_active_test',
|
||||
'variable',
|
||||
|
|
|
|||
|
|
@ -147,7 +147,6 @@ class Upgrade7Test extends MigrateUpgradeExecuteTestBase {
|
|||
'link',
|
||||
'list',
|
||||
'menu',
|
||||
'node',
|
||||
'number',
|
||||
'options',
|
||||
'path',
|
||||
|
|
@ -188,6 +187,7 @@ class Upgrade7Test extends MigrateUpgradeExecuteTestBase {
|
|||
'i18n_taxonomy',
|
||||
'i18n_translation',
|
||||
'locale',
|
||||
'node',
|
||||
'variable',
|
||||
'variable_realm',
|
||||
'variable_store',
|
||||
|
|
|
|||
Loading…
Reference in New Issue