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