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
91ab3cc3
Commit
91ab3cc3
authored
Jul 14, 2015
by
Alex Pott
Browse files
Issue
#2514168
by phenaproxima, mikeryan, benjy: Streamline migrate_drupal integration tests
parent
8cb41027
Changes
88
Hide whitespace changes
Inline
Side-by-side
core/modules/migrate/src/Tests/MigrateTestBase.php
View file @
91ab3cc3
...
...
@@ -8,7 +8,9 @@
namespace
Drupal\migrate\Tests
;
use
Drupal\Core\Database\Database
;
use
Drupal\migrate\Entity\Migration
;
use
Drupal\migrate\Entity\MigrationInterface
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate\MigrateMessageInterface
;
use
Drupal\migrate\Row
;
use
Drupal\simpletest\KernelTestBase
;
...
...
@@ -73,21 +75,6 @@ protected function tearDown() {
parent
::
tearDown
();
}
/**
* Prepare the migration.
*
* @param \Drupal\migrate\Entity\MigrationInterface $migration
* The migration object.
* @param array $files
* An array of files.
*/
protected
function
prepare
(
MigrationInterface
$migration
,
array
$files
=
array
())
{
$this
->
loadDumps
(
$files
);
if
(
$this
instanceof
MigrateDumpAlterInterface
)
{
static
::
migrateDumpAlter
(
$this
);
}
}
/**
* Load Drupal 6 database dumps to be used.
*
...
...
@@ -96,7 +83,7 @@ protected function prepare(MigrationInterface $migration, array $files = array()
* @param string $method
* The name of the method in the dump class to use. Defaults to load.
*/
protected
function
loadDumps
(
$files
,
$method
=
'load'
)
{
protected
function
loadDumps
(
array
$files
,
$method
=
'load'
)
{
// Load the database from the portable PHP dump.
// The files may be gzipped.
foreach
(
$files
as
$file
)
{
...
...
@@ -137,6 +124,22 @@ protected function prepareMigrations(array $id_mappings) {
}
}
/**
* Executes a single migration.
*
* @param string|\Drupal\migrate\Entity\MigrationInterface $migration
* The migration to execute, or its ID.
*/
protected
function
executeMigration
(
$migration
)
{
if
(
is_string
(
$migration
))
{
$migration
=
Migration
::
load
(
$migration
);
}
if
(
$this
instanceof
MigrateDumpAlterInterface
)
{
static
::
migrateDumpAlter
(
$this
);
}
(
new
MigrateExecutable
(
$migration
,
$this
))
->
import
();
}
/**
* {@inheritdoc}
*/
...
...
core/modules/migrate_drupal/src/Tests/MigrateDrupalTestBase.php
View file @
91ab3cc3
...
...
@@ -28,7 +28,7 @@ abstract class MigrateDrupalTestBase extends MigrateTestBase {
*/
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
loadDumps
([
$this
->
getDumpDirectory
()
.
'/
System.php'
]);
$this
->
loadDumps
([
'
System.php'
]);
$this
->
installEntitySchema
(
'user'
);
$this
->
installConfig
([
'migrate_drupal'
,
'system'
]);
...
...
@@ -44,6 +44,14 @@ protected function getDumpDirectory() {
return
__DIR__
.
'/Table'
;
}
/**
* {@inheritdoc}
*/
protected
function
loadDumps
(
array
$files
,
$method
=
'load'
)
{
$files
=
array_map
(
function
(
$file
)
{
return
$this
->
getDumpDirectory
()
.
'/'
.
$file
;
},
$files
);
parent
::
loadDumps
(
$files
,
$method
);
}
/**
* Turn all the migration templates for the specified drupal version into
* real migration entities so we can test them.
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateActionConfigsTest.php
View file @
91ab3cc3
...
...
@@ -8,8 +8,6 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\config\Tests\SchemaCheckTestTrait
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
/**
* Upgrade variables to action.settings.yml.
...
...
@@ -32,13 +30,8 @@ class MigrateActionConfigsTest extends MigrateDrupal6TestBase {
*/
protected
function
setUp
()
{
parent
::
setUp
();
$migration
=
entity_load
(
'migration'
,
'd6_action_settings'
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Variable.php'
,
);
$this
->
prepare
(
$migration
,
$dumps
);
$executable
=
new
MigrateExecutable
(
$migration
,
$this
);
$executable
->
import
();
$this
->
loadDumps
([
'Variable.php'
]);
$this
->
executeMigration
(
'd6_action_settings'
);
}
/**
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorConfigsTest.php
View file @
91ab3cc3
...
...
@@ -8,8 +8,6 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\config\Tests\SchemaCheckTestTrait
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
/**
* Upgrade variables to aggregator.settings.yml.
...
...
@@ -32,13 +30,8 @@ class MigrateAggregatorConfigsTest extends MigrateDrupal6TestBase {
*/
protected
function
setUp
()
{
parent
::
setUp
();
$migration
=
entity_load
(
'migration'
,
'd6_aggregator_settings'
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Variable.php'
,
);
$this
->
prepare
(
$migration
,
$dumps
);
$executable
=
new
MigrateExecutable
(
$migration
,
$this
);
$executable
->
import
();
$this
->
loadDumps
([
'Variable.php'
]);
$this
->
executeMigration
(
'd6_aggregator_settings'
);
}
/**
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorFeedTest.php
View file @
91ab3cc3
...
...
@@ -8,8 +8,6 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\aggregator\Entity\Feed
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
/**
* Upgrade variables to aggregator_feed entities.
...
...
@@ -26,14 +24,8 @@ class MigrateAggregatorFeedTest extends MigrateDrupal6TestBase {
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
installEntitySchema
(
'aggregator_feed'
);
$migration
=
entity_load
(
'migration'
,
'd6_aggregator_feed'
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/AggregatorFeed.php'
,
);
$this
->
prepare
(
$migration
,
$dumps
);
$executable
=
new
MigrateExecutable
(
$migration
,
$this
);
$executable
->
import
();
$this
->
loadDumps
([
'AggregatorFeed.php'
]);
$this
->
executeMigration
(
'd6_aggregator_feed'
);
}
/**
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorItemTest.php
View file @
91ab3cc3
...
...
@@ -8,9 +8,6 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\aggregator\Entity\Item
;
use
Drupal\Core\Language\LanguageInterface
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
/**
* Upgrade aggregator items.
...
...
@@ -47,14 +44,8 @@ protected function setUp() {
));
$entity
->
enforceIsNew
();
$entity
->
save
();
/** @var \Drupal\migrate\entity\Migration $migration */
$migration
=
entity_load
(
'migration'
,
'd6_aggregator_item'
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/AggregatorItem.php'
,
);
$this
->
prepare
(
$migration
,
$dumps
);
$executable
=
new
MigrateExecutable
(
$migration
,
$this
);
$executable
->
import
();
$this
->
loadDumps
([
'AggregatorItem.php'
]);
$this
->
executeMigration
(
'd6_aggregator_item'
);
}
/**
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateBlockContentTest.php
View file @
91ab3cc3
...
...
@@ -7,12 +7,7 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\Core\Language\Language
;
use
Drupal\block_content
\
Entity\BlockContent
;
use
Drupal\Core\Language\LanguageInterface
;
use
Drupal\field\Entity\FieldStorageConfig
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
/**
* Upgrade custom blocks.
...
...
@@ -31,26 +26,16 @@ protected function setUp() {
$this
->
installConfig
(
array
(
'block_content'
));
$this
->
installEntitySchema
(
'block_content'
);
$migration
=
entity_load
(
'migration'
,
'd6_block_content_type'
);
$executable
=
new
MigrateExecutable
(
$migration
,
$this
);
$executable
->
import
();
$migration
=
entity_load
(
'migration'
,
'd6_block_content_body_field'
);
$executable
=
new
MigrateExecutable
(
$migration
,
$this
);
$executable
->
import
();
$this
->
executeMigration
(
'd6_block_content_type'
);
$this
->
executeMigration
(
'd6_block_content_body_field'
);
$this
->
prepareMigrations
(
array
(
'd6_filter_format'
=>
array
(
array
(
array
(
2
),
array
(
'full_html'
))
)
));
/** @var \Drupal\migrate\entity\Migration $migration */
$migration
=
entity_load
(
'migration'
,
'd6_custom_block'
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Boxes.php'
,
);
$this
->
prepare
(
$migration
,
$dumps
);
$executable
=
new
MigrateExecutable
(
$migration
,
$this
);
$executable
->
import
();
$this
->
loadDumps
([
'Boxes.php'
]);
$this
->
executeMigration
(
'd6_custom_block'
);
}
/**
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php
View file @
91ab3cc3
...
...
@@ -7,8 +7,6 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
use
Drupal\block\Entity\Block
;
/**
...
...
@@ -72,16 +70,8 @@ protected function setUp() {
// Install one of D8's test themes.
\
Drupal
::
service
(
'theme_handler'
)
->
install
(
array
(
'test_theme'
));
/** @var \Drupal\migrate\entity\Migration $migration */
$migration
=
entity_load
(
'migration'
,
'd6_block'
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Blocks.php'
,
$this
->
getDumpDirectory
()
.
'/BlocksRoles.php'
,
$this
->
getDumpDirectory
()
.
'/AggregatorFeed.php'
,
);
$this
->
prepare
(
$migration
,
$dumps
);
$executable
=
new
MigrateExecutable
(
$migration
,
$this
);
$executable
->
import
();
$this
->
loadDumps
([
'Blocks.php'
,
'BlocksRoles.php'
,
'AggregatorFeed.php'
]);
$this
->
executeMigration
(
'd6_block'
);
}
/**
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateBookConfigsTest.php
View file @
91ab3cc3
...
...
@@ -8,9 +8,6 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\config\Tests\SchemaCheckTestTrait
;
use
Drupal\migrate\MigrateMessage
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
/**
* Upgrade variables to book.settings.yml.
...
...
@@ -33,14 +30,8 @@ class MigrateBookConfigsTest extends MigrateDrupal6TestBase {
*/
protected
function
setUp
()
{
parent
::
setUp
();
$migration
=
entity_load
(
'migration'
,
'd6_book_settings'
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Variable.php'
,
);
$this
->
prepare
(
$migration
,
$dumps
);
$executable
=
new
MigrateExecutable
(
$migration
,
new
MigrateMessage
());
$executable
->
import
();
$this
->
loadDumps
([
'Variable.php'
]);
$this
->
executeMigration
(
'd6_book_settings'
);
}
/**
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateBookTest.php
View file @
91ab3cc3
...
...
@@ -7,8 +7,6 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
use
Drupal\node\Entity\Node
;
/**
...
...
@@ -44,15 +42,8 @@ protected function setUp() {
}
$this
->
prepareMigrations
(
$id_mappings
);
// Load database dumps to provide source data.
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Book.php'
,
$this
->
getDumpDirectory
()
.
'/MenuLinks.php'
,
);
$this
->
loadDumps
(
$dumps
);
// Migrate books..
$migration
=
entity_load
(
'migration'
,
'd6_book'
);
$executable
=
new
MigrateExecutable
(
$migration
,
$this
);
$executable
->
import
();
$this
->
loadDumps
([
'Book.php'
,
'MenuLinks.php'
]);
$this
->
executeMigration
(
'd6_book'
);
}
/**
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateCckFieldValuesTest.php
View file @
91ab3cc3
...
...
@@ -7,7 +7,6 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\Core\Database\Database
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\node\Entity\Node
;
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTest.php
View file @
91ab3cc3
...
...
@@ -7,11 +7,7 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\comment\Entity\Comment
;
use
Drupal\comment\Tests\CommentTestTrait
;
use
Drupal\Core\Language\LanguageInterface
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
/**
* Upgrade comments.
...
...
@@ -60,21 +56,16 @@ protected function setUp() {
);
$this
->
prepareMigrations
(
$id_mappings
);
/** @var \Drupal\migrate\entity\Migration $migration */
$migration
=
entity_load
(
'migration'
,
'd6_comment'
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Node.php'
,
$this
->
getDumpDirectory
()
.
'/NodeRevisions.php'
,
$this
->
getDumpDirectory
()
.
'/ContentTypeStory.php'
,
$this
->
getDumpDirectory
()
.
'/ContentTypeTestPlanet.php'
,
$this
->
getDumpDirectory
()
.
'/Variable.php'
,
$this
->
getDumpDirectory
()
.
'/NodeType.php'
,
$this
->
getDumpDirectory
()
.
'/Comments.php'
,
);
$this
->
prepare
(
$migration
,
$dumps
);
$executable
=
new
MigrateExecutable
(
$migration
,
$this
);
$executable
->
import
();
$this
->
loadDumps
([
'Node.php'
,
'NodeRevisions.php'
,
'ContentTypeStory.php'
,
'ContentTypeTestPlanet.php'
,
'Variable.php'
,
'NodeType.php'
,
'Comments.php'
,
]);
$this
->
executeMigration
(
'd6_comment'
);
}
/**
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateCommentTypeTest.php
View file @
91ab3cc3
...
...
@@ -8,8 +8,6 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\comment\Entity\CommentType
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
/**
* Upgrade comment type.
...
...
@@ -30,16 +28,8 @@ protected function setUp() {
$this
->
installEntitySchema
(
'comment'
);
$this
->
installConfig
([
'node'
,
'comment'
]);
/** @var \Drupal\migrate\entity\Migration $migration */
$migration
=
entity_load
(
'migration'
,
'd6_comment_type'
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Variable.php'
,
$this
->
getDumpDirectory
()
.
'/NodeType.php'
,
);
$this
->
prepare
(
$migration
,
$dumps
);
$executable
=
new
MigrateExecutable
(
$migration
,
$this
);
$executable
->
import
();
$this
->
loadDumps
([
'Variable.php'
,
'NodeType.php'
]);
$this
->
executeMigration
(
'd6_comment_type'
);
}
/**
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableDisplayBase.php
View file @
91ab3cc3
...
...
@@ -7,9 +7,6 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
/**
* Base class for Drupal 6 comment variables to Drupal 8 entity display tests.
*/
...
...
@@ -30,13 +27,6 @@ abstract class MigrateCommentVariableDisplayBase extends MigrateDrupal6TestBase
*/
static
$modules
=
array
(
'comment'
,
'node'
);
/**
* The database dumps used.
*
* @var array
*/
protected
$dumps
;
/**
* The node types being tested.
*
...
...
@@ -66,21 +56,14 @@ protected function setUp() {
'required'
=>
1
,
))
->
save
();
}
$this
->
dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Variable.php'
,
$this
->
getDumpDirectory
()
.
'/NodeType.php'
,
);
$id_mappings
=
array
(
'd6_comment_field_instance'
=>
array
(
array
(
array
(
'page'
),
array
(
'node'
,
'comment'
,
'page'
)),
),
);
$this
->
prepareMigrations
(
$id_mappings
);
/** @var \Drupal\migrate\entity\Migration $migration */
$migration
=
entity_load
(
'migration'
,
static
::
MIGRATION
);
$this
->
prepare
(
$migration
,
$this
->
dumps
);
$executable
=
new
MigrateExecutable
(
$migration
,
$this
);
$executable
->
import
();
$this
->
loadDumps
([
'Variable.php'
,
'NodeType.php'
]);
$this
->
executeMigration
(
static
::
MIGRATION
);
}
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php
View file @
91ab3cc3
...
...
@@ -7,9 +7,6 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
/**
* Upgrade comment subject variable to core.entity_form_display.comment.*.default.yml
*
...
...
@@ -43,15 +40,8 @@ protected function setUp() {
),
);
$this
->
prepareMigrations
(
$id_mappings
);
/** @var \Drupal\migrate\entity\Migration $migration */
$migration
=
entity_load
(
'migration'
,
'd6_comment_entity_form_display_subject'
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Variable.php'
,
$this
->
getDumpDirectory
()
.
'/NodeType.php'
,
);
$this
->
prepare
(
$migration
,
$dumps
);
$executable
=
new
MigrateExecutable
(
$migration
,
$this
);
$executable
->
import
();
$this
->
loadDumps
([
'Variable.php'
,
'NodeType.php'
]);
$this
->
executeMigration
(
'd6_comment_entity_form_display_subject'
);
}
/**
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableFieldTest.php
View file @
91ab3cc3
...
...
@@ -8,8 +8,6 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\field\Entity\FieldStorageConfig
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
/**
* Upgrade comment variables to field.storage.node.comment.yml.
...
...
@@ -42,15 +40,8 @@ protected function setUp() {
),
);
$this
->
prepareMigrations
(
$id_mappings
);
/** @var \Drupal\migrate\entity\Migration $migration */
$migration
=
entity_load
(
'migration'
,
'd6_comment_field'
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Variable.php'
,
$this
->
getDumpDirectory
()
.
'/NodeType.php'
,
);
$this
->
prepare
(
$migration
,
$dumps
);
$executable
=
new
MigrateExecutable
(
$migration
,
$this
);
$executable
->
import
();
$this
->
loadDumps
([
'Variable.php'
,
'NodeType.php'
]);
$this
->
executeMigration
(
'd6_comment_field'
);
}
/**
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateCommentVariableInstanceTest.php
View file @
91ab3cc3
...
...
@@ -7,9 +7,6 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
/**
* Upgrade comment variables to field.instance.node.*.comment.yml.
*
...
...
@@ -50,15 +47,8 @@ protected function setUp() {
'type'
=>
'comment'
,
'translatable'
=>
'0'
,
))
->
save
();
/** @var \Drupal\migrate\entity\Migration $migration */
$migration
=
entity_load
(
'migration'
,
'd6_comment_field_instance'
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Variable.php'
,
$this
->
getDumpDirectory
()
.
'/NodeType.php'
,
);
$this
->
prepare
(
$migration
,
$dumps
);
$executable
=
new
MigrateExecutable
(
$migration
,
$this
);
$executable
->
import
();
$this
->
loadDumps
([
'Variable.php'
,
'NodeType.php'
]);
$this
->
executeMigration
(
'd6_comment_field_instance'
);
}
/**
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateContactCategoryTest.php
View file @
91ab3cc3
...
...
@@ -8,9 +8,6 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\contact\Entity\ContactForm
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate\MigrateMessage
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
/**
* Migrate contact categories to contact.form.*.yml.
...
...
@@ -31,13 +28,8 @@ class MigrateContactCategoryTest extends MigrateDrupal6TestBase {
*/
protected
function
setUp
()
{
parent
::
setUp
();
$migration
=
entity_load
(
'migration'
,
'd6_contact_category'
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Contact.php'
,
);
$this
->
prepare
(
$migration
,
$dumps
);
$executable
=
new
MigrateExecutable
(
$migration
,
new
MigrateMessage
());
$executable
->
import
();
$this
->
loadDumps
([
'Contact.php'
]);
$this
->
executeMigration
(
'd6_contact_category'
);
}
/**
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateContactConfigsTest.php
View file @
91ab3cc3
...
...
@@ -8,9 +8,6 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\config\Tests\SchemaCheckTestTrait
;
use
Drupal\migrate\MigrateMessage
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
/**
* Upgrade variables to contact.settings.yml.
...
...
@@ -41,14 +38,8 @@ protected function setUp() {
),
);
$this
->
prepareMigrations
(
$id_mappings
);
$migration
=
entity_load
(
'migration'
,
'd6_contact_settings'
);
$dumps
=
array
(
$this
->
getDumpDirectory
()
.
'/Variable.php'
,
$this
->
getDumpDirectory
()
.
'/Contact.php'
,
);
$this
->
prepare
(
$migration
,
$dumps
);
$executable
=
new
MigrateExecutable
(
$migration
,
new
MigrateMessage
());
$executable
->
import
();
$this
->
loadDumps
([
'Variable.php'
,
'Contact.php'
]);
$this
->
executeMigration
(
'd6_contact_settings'
);
}
/**
...
...
core/modules/migrate_drupal/src/Tests/d6/MigrateDateFormatTest.php
View file @
91ab3cc3
...
...
@@ -7,10 +7,7 @@
namespace
Drupal\migrate_drupal\Tests\d6
;
use
Drupal\Core\Datetime\DrupalDateTime
;
use
Drupal\migrate\MigrateMessage
;
use
Drupal\migrate\MigrateExecutable
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
use
Drupal\Core\Database\Database
;