Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
37df1bd0
Commit
37df1bd0
authored
Aug 13, 2014
by
alexpott
Browse files
Issue
#2315489
by benjy: Renamed prepareIdMappings() in MigrateTestBase.
parent
f8c9cf8b
Changes
36
Hide whitespace changes
Inline
Side-by-side
core/modules/migrate/src/Tests/MigrateTestBase.php
View file @
37df1bd0
...
...
@@ -104,21 +104,20 @@ protected function loadDumps($files, $method = 'load') {
}
/**
* Prepare
the id mapping
s.
* Prepare
any dependent migration
s.
*
* @param array $id_mappings
* A list of id mappings keyed by migration ids. Each id mapping is a list
* of two arrays, the first are source ids and the second are destination
* ids.
*/
protected
function
prepare
IdMapping
s
(
array
$id_mappings
)
{
protected
function
prepare
Migration
s
(
array
$id_mappings
)
{
/** @var \Drupal\migrate\Entity\MigrationInterface[] $migrations */
$migrations
=
entity_load_multiple
(
'migration'
,
array_keys
(
$id_mappings
));
foreach
(
$id_mappings
as
$migration_id
=>
$data
)
{
$migration
=
$migrations
[
$migration_id
];
// @TODO, rename prepareIdMappings() in https://drupal.org/node/2315489
// which will make the position of this more appropriate.
// Mark the dependent migrations as complete.
$migration
->
setMigrationResult
(
MigrationInterface
::
RESULT_COMPLETED
);
$id_map
=
$migration
->
getIdMap
();
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php
View file @
37df1bd0
...
...
@@ -32,7 +32,7 @@ public function setUp() {
array
(
array
(
5
),
array
(
5
)),
),
);
$this
->
prepare
IdMapping
s
(
$id_mappings
);
$this
->
prepare
Migration
s
(
$id_mappings
);
$entity
=
entity_create
(
'aggregator_feed'
,
array
(
'fid'
=>
5
,
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateBlockContentTest.php
View file @
37df1bd0
...
...
@@ -27,7 +27,7 @@ class MigrateBlockContentTest extends MigrateDrupalTestBase {
*/
public
function
setUp
()
{
parent
::
setUp
();
$this
->
prepare
IdMapping
s
(
array
(
$this
->
prepare
Migration
s
(
array
(
'd6_filter_format'
=>
array
(
array
(
array
(
2
),
array
(
'full_html'
))
)
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php
View file @
37df1bd0
...
...
@@ -46,7 +46,7 @@ public function setUp() {
$entity
->
enforceIsNew
(
TRUE
);
$entity
->
save
();
}
$this
->
prepare
IdMapping
s
(
array
(
$this
->
prepare
Migration
s
(
array
(
'd6_custom_block'
=>
array
(
array
(
array
(
10
),
array
(
1
)),
array
(
array
(
11
),
array
(
2
)),
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateBookTest.php
View file @
37df1bd0
...
...
@@ -35,7 +35,7 @@ protected function setUp() {
$entity
->
save
();
$id_mappings
[
'd6_node'
][]
=
array
(
array
(
$i
),
array
(
$i
));
}
$this
->
prepare
IdMapping
s
(
$id_mappings
);
$this
->
prepare
Migration
s
(
$id_mappings
);
// Load database dumps to provide source data.
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Drupal6Book.php'
,
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldRevisionTest.php
View file @
37df1bd0
...
...
@@ -63,7 +63,7 @@ protected function setUp() {
array
(
array
(
1
),
array
(
1
)),
),
);
$this
->
prepare
IdMapping
s
(
$id_mappings
);
$this
->
prepare
Migration
s
(
$id_mappings
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Drupal6NodeRevision.php'
,
);
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldValuesTest.php
View file @
37df1bd0
...
...
@@ -84,7 +84,7 @@ protected function setUp() {
array
(
array
(
2
),
array
(
2
)),
),
);
$this
->
prepare
IdMapping
s
(
$id_mappings
);
$this
->
prepare
Migration
s
(
$id_mappings
);
$migrations
=
entity_load_multiple
(
'migration'
,
array
(
'd6_cck_field_values:*'
));
foreach
(
$migrations
as
$migration
)
{
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php
View file @
37df1bd0
...
...
@@ -53,7 +53,7 @@ public function setUp() {
'd6_comment_entity_display'
=>
array
(
array
(
array
(
'story'
),
array
(
'node'
,
'story'
,
'default'
,
'comment'
))),
'd6_comment_entity_form_display'
=>
array
(
array
(
array
(
'story'
),
array
(
'node'
,
'story'
,
'default'
,
'comment'
))),
);
$this
->
prepare
IdMapping
s
(
$id_mappings
);
$this
->
prepare
Migration
s
(
$id_mappings
);
\
Drupal
::
service
(
'comment.manager'
)
->
addDefaultField
(
'node'
,
'story'
);
/** @var \Drupal\migrate\entity\Migration $migration */
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableDisplayBase.php
View file @
37df1bd0
...
...
@@ -74,7 +74,7 @@ protected function setUp() {
array
(
array
(
'page'
),
array
(
'node'
,
'comment'
,
'page'
)),
),
);
$this
->
prepare
IdMapping
s
(
$id_mappings
);
$this
->
prepare
Migration
s
(
$id_mappings
);
/** @var \Drupal\migrate\entity\Migration $migration */
$migration
=
entity_load
(
'migration'
,
static
::
MIGRATION
);
$this
->
prepare
(
$migration
,
$this
->
dumps
);
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php
View file @
37df1bd0
...
...
@@ -42,7 +42,7 @@ public function setUp() {
array
(
array
(
'comment'
),
array
(
'comment_no_subject'
)),
),
);
$this
->
prepare
IdMapping
s
(
$id_mappings
);
$this
->
prepare
Migration
s
(
$id_mappings
);
/** @var \Drupal\migrate\entity\Migration $migration */
$migration
=
entity_load
(
'migration'
,
'd6_comment_entity_form_display_subject'
);
$dumps
=
array
(
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableFieldTest.php
View file @
37df1bd0
...
...
@@ -40,7 +40,7 @@ public function setUp() {
array
(
array
(
'comment'
),
array
(
'comment_no_subject'
)),
),
);
$this
->
prepare
IdMapping
s
(
$id_mappings
);
$this
->
prepare
Migration
s
(
$id_mappings
);
/** @var \Drupal\migrate\entity\Migration $migration */
$migration
=
entity_load
(
'migration'
,
'd6_comment_field'
);
$dumps
=
array
(
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php
View file @
37df1bd0
...
...
@@ -33,7 +33,7 @@ public function setUp() {
array
(
array
(
'page'
),
array
(
'page'
)),
),
);
$this
->
prepare
IdMapping
s
(
$id_mappings
);
$this
->
prepare
Migration
s
(
$id_mappings
);
foreach
(
array
(
'page'
,
'story'
)
as
$type
)
{
entity_create
(
'node_type'
,
array
(
'type'
=>
$type
))
->
save
();
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateContactConfigsTest.php
View file @
37df1bd0
...
...
@@ -40,7 +40,7 @@ public function setUp() {
array
(
array
(
2
),
array
(
'some_other_category'
)),
),
);
$this
->
prepare
IdMapping
s
(
$id_mappings
);
$this
->
prepare
Migration
s
(
$id_mappings
);
$migration
=
entity_load
(
'migration'
,
'd6_contact_settings'
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Drupal6ContactSettings.php'
,
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateFieldFormatterSettingsTest.php
View file @
37df1bd0
...
...
@@ -60,7 +60,7 @@ public function setUp() {
array
(
array
(
'field_test_datetime'
),
array
(
'node'
,
'field_test_datetime'
)),
),
);
$this
->
prepare
IdMapping
s
(
$id_mappings
);
$this
->
prepare
Migration
s
(
$id_mappings
);
$migration
=
entity_load
(
'migration'
,
'd6_field_formatter_settings'
);
$dumps
=
array
(
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateFieldInstanceTest.php
View file @
37df1bd0
...
...
@@ -60,7 +60,7 @@ public function setUp() {
array
(
array
(
'test_page'
),
array
(
'test_page'
)),
),
);
$this
->
prepare
IdMapping
s
(
$id_mappings
);
$this
->
prepare
Migration
s
(
$id_mappings
);
entity_create
(
'node_type'
,
array
(
'type'
=>
'page'
))
->
save
();
entity_create
(
'node_type'
,
array
(
'type'
=>
'story'
))
->
save
();
entity_create
(
'node_type'
,
array
(
'type'
=>
'test_page'
))
->
save
();
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateFieldWidgetSettingsTest.php
View file @
37df1bd0
...
...
@@ -60,7 +60,7 @@ public function setUp() {
array
(
array
(
'field_test_datetime'
),
array
(
'node'
,
'field_test_datetime'
)),
),
);
$this
->
prepare
IdMapping
s
(
$id_mappings
);
$this
->
prepare
Migration
s
(
$id_mappings
);
$migration
=
entity_load
(
'migration'
,
'd6_field_instance_widget_settings'
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Drupal6FieldInstance.php'
,
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateNodeRevisionTest.php
View file @
37df1bd0
...
...
@@ -26,7 +26,7 @@ protected function setUp() {
array
(
array
(
1
),
array
(
1
)),
),
);
$this
->
prepare
IdMapping
s
(
$id_mappings
);
$this
->
prepare
Migration
s
(
$id_mappings
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Drupal6NodeRevision.php'
,
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateNodeTestBase.php
View file @
37df1bd0
...
...
@@ -47,7 +47,7 @@ protected function setUp() {
),
),
);
$this
->
prepare
IdMapping
s
(
$id_mappings
);
$this
->
prepare
Migration
s
(
$id_mappings
);
$migration
=
entity_load
(
'migration'
,
'd6_node_settings'
);
$migration
->
setMigrationResult
(
MigrationInterface
::
RESULT_COMPLETED
);
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateProfileValuesTest.php
View file @
37df1bd0
...
...
@@ -123,7 +123,7 @@ protected function setUp() {
array
(
array
(
15
),
array
(
15
)),
),
);
$this
->
prepare
IdMapping
s
(
$id_mappings
);
$this
->
prepare
Migration
s
(
$id_mappings
);
// Load database dumps to provide source data.
$dumps
=
array
(
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyTermTest.php
View file @
37df1bd0
...
...
@@ -25,7 +25,7 @@ class MigrateTaxonomyTermTest extends MigrateDrupalTestBase {
*/
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
prepare
IdMapping
s
(
array
(
$this
->
prepare
Migration
s
(
array
(
'd6_taxonomy_vocabulary'
=>
array
(
array
(
array
(
1
),
array
(
'vocabulary_1_i_0_'
)),
array
(
array
(
2
),
array
(
'vocabulary_2_i_1_'
)),
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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