Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
90c7d4c3
Verified
Commit
90c7d4c3
authored
Jul 31, 2020
by
Lee Rowlands
Browse files
Issue
#3154398
by neclimdul, quietone, alexpott: Migrations don't have an accessor for requirements
parent
1671837e
Changes
3
Hide whitespace changes
Inline
Side-by-side
core/modules/migrate/src/Plugin/Migration.php
View file @
90c7d4c3
...
...
@@ -417,6 +417,13 @@ public function getIdMap() {
return
$this
->
idMapPlugin
;
}
/**
* {@inheritDoc}
*/
public
function
getRequirements
():
array
{
return
$this
->
requirements
;
}
/**
* {@inheritdoc}
*/
...
...
core/modules/migrate/src/Plugin/MigrationInterface.php
View file @
90c7d4c3
...
...
@@ -103,6 +103,13 @@ public function id();
*/
public
function
label
();
/**
* Get a list of required plugin IDs.
*
* @returns string[]
*/
public
function
getRequirements
():
array
;
/**
* Returns the initialized source plugin.
*
...
...
core/modules/migrate/tests/src/Unit/MigrationTest.php
View file @
90c7d4c3
...
...
@@ -113,6 +113,19 @@ public function testRequirementsForMigrations() {
$migration
->
checkRequirements
();
}
/**
* Tests getting requirement list.
*
* @covers ::getRequirements
*/
public
function
testGetMigrations
()
{
$migration
=
new
TestMigration
();
$requirements
=
[
'test_a'
,
'test_b'
,
'test_c'
,
'test_d'
];
$migration
->
setRequirements
(
$requirements
);
$this
->
assertArrayEquals
(
$requirements
,
$migration
->
getRequirements
());
}
/**
* Tests valid migration dependencies configuration returns expected values.
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment