Problem/Motivation
Migration::set() was provided as a work-around for the inability to properly modify migration plugin configuration at run time (#2681869: Provide clean way to merge configuration into migration plugins) - once that is committed, set() should be deprecated. The only core usages remaining after that commit are in tests, which should be changed to use the plugin manager to merge configuration.
Note that set() is documented with {@inheritdoc}, yet is not in MigrationInterface and thus is not properly documented. This fix should properly document it in the Migration class.
Proposed resolution
Add individual setters to MigrationInterface and implement them in Migration. Setters added are
setDependencies(array $value)
setRequirements(array $value)
In MigrateTestBase, add an optional $configuration
parameter to getMigration()
and executeMigration()
, where $configuration
is an array of values to merge into the migration definition.
In MigrateTestBase and the traits for file migrations, remove prepareMigration()
. Instead, the traits add fileConfiguration()
. Tests that run file migrations pass that to executeMigration()
.
Change the use of Migration::set() in
- MigrationPluginManager
- d6/MigrateUploadTest
- d6/FileMigrationTestTrait
- d7/FileMigrationSetupTrait
- ReferenceBase.php
Move test in MigrationTest to MigrationPluginConfigurationTest.php
Add doc bloc for Migration::set() and deprecate it.
Theses changes may require changes to migration tests in contrib.
Remaining tasks
This issue is postponed on #3262395: $migration_dependencies has inconsistent structure.
If #2953111: Only migrate role permissions that exist on the destination is fixed before this issue, then update the test. See Comment #43.14 there.
Add follow-up issues for the following contrib modules (see #83 here):
media_migration
location_migration
migrate_tools
migrate_upgrade