Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
8477f6b7
Commit
8477f6b7
authored
Sep 28, 2015
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2554321
by phenaproxima, mikeryan, quietone, neclimdul, benjy: Clean up Migrate's test suite
parent
07c8d58c
Changes
112
Hide whitespace changes
Inline
Side-by-side
Showing
75 changed files
with
516 additions
and
1310 deletions
+516
-1310
core/modules/action/src/Tests/Migrate/d6/MigrateActionConfigsTest.php
.../action/src/Tests/Migrate/d6/MigrateActionConfigsTest.php
+2
-4
core/modules/aggregator/src/Tests/Migrate/d6/MigrateAggregatorConfigsTest.php
...tor/src/Tests/Migrate/d6/MigrateAggregatorConfigsTest.php
+2
-4
core/modules/aggregator/src/Tests/Migrate/d6/MigrateAggregatorFeedTest.php
...egator/src/Tests/Migrate/d6/MigrateAggregatorFeedTest.php
+4
-1
core/modules/aggregator/src/Tests/Migrate/d6/MigrateAggregatorItemTest.php
...egator/src/Tests/Migrate/d6/MigrateAggregatorItemTest.php
+5
-21
core/modules/block/src/Tests/Migrate/d6/MigrateBlockTest.php
core/modules/block/src/Tests/Migrate/d6/MigrateBlockTest.php
+15
-33
core/modules/block/src/Tests/Migrate/d7/MigrateBlockTest.php
core/modules/block/src/Tests/Migrate/d7/MigrateBlockTest.php
+10
-10
core/modules/block_content/src/Tests/Migrate/MigrateBlockContentBodyFieldTest.php
...nt/src/Tests/Migrate/MigrateBlockContentBodyFieldTest.php
+4
-2
core/modules/block_content/src/Tests/Migrate/d6/MigrateBlockContentTest.php
..._content/src/Tests/Migrate/d6/MigrateBlockContentTest.php
+11
-11
core/modules/block_content/src/Tests/Migrate/d7/MigrateCustomBlockTest.php
...k_content/src/Tests/Migrate/d7/MigrateCustomBlockTest.php
+6
-4
core/modules/book/src/Tests/Migrate/d6/MigrateBookConfigsTest.php
...ules/book/src/Tests/Migrate/d6/MigrateBookConfigsTest.php
+2
-4
core/modules/book/src/Tests/Migrate/d6/MigrateBookTest.php
core/modules/book/src/Tests/Migrate/d6/MigrateBookTest.php
+7
-27
core/modules/comment/src/Tests/Migrate/d6/MigrateCommentTest.php
...dules/comment/src/Tests/Migrate/d6/MigrateCommentTest.php
+20
-32
core/modules/comment/src/Tests/Migrate/d6/MigrateCommentTypeTest.php
...s/comment/src/Tests/Migrate/d6/MigrateCommentTypeTest.php
+4
-1
core/modules/comment/src/Tests/Migrate/d6/MigrateCommentVariableDisplayBase.php
...rc/Tests/Migrate/d6/MigrateCommentVariableDisplayBase.php
+9
-44
core/modules/comment/src/Tests/Migrate/d6/MigrateCommentVariableEntityDisplayTest.php
...ts/Migrate/d6/MigrateCommentVariableEntityDisplayTest.php
+9
-9
core/modules/comment/src/Tests/Migrate/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php
...d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php
+10
-21
core/modules/comment/src/Tests/Migrate/d6/MigrateCommentVariableEntityFormDisplayTest.php
...igrate/d6/MigrateCommentVariableEntityFormDisplayTest.php
+10
-4
core/modules/comment/src/Tests/Migrate/d6/MigrateCommentVariableFieldTest.php
.../src/Tests/Migrate/d6/MigrateCommentVariableFieldTest.php
+7
-19
core/modules/comment/src/Tests/Migrate/d6/MigrateCommentVariableInstanceTest.php
...c/Tests/Migrate/d6/MigrateCommentVariableInstanceTest.php
+14
-30
core/modules/comment/src/Tests/Migrate/d7/MigrateCommentEntityDisplayTest.php
.../src/Tests/Migrate/d7/MigrateCommentEntityDisplayTest.php
+7
-5
core/modules/comment/src/Tests/Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php
...Migrate/d7/MigrateCommentEntityFormDisplaySubjectTest.php
+5
-3
core/modules/comment/src/Tests/Migrate/d7/MigrateCommentEntityFormDisplayTest.php
.../Tests/Migrate/d7/MigrateCommentEntityFormDisplayTest.php
+7
-5
core/modules/comment/src/Tests/Migrate/d7/MigrateCommentFieldInstanceTest.php
.../src/Tests/Migrate/d7/MigrateCommentFieldInstanceTest.php
+6
-4
core/modules/comment/src/Tests/Migrate/d7/MigrateCommentFieldTest.php
.../comment/src/Tests/Migrate/d7/MigrateCommentFieldTest.php
+5
-3
core/modules/comment/src/Tests/Migrate/d7/MigrateCommentTest.php
...dules/comment/src/Tests/Migrate/d7/MigrateCommentTest.php
+10
-6
core/modules/comment/src/Tests/Migrate/d7/MigrateCommentTypeTest.php
...s/comment/src/Tests/Migrate/d7/MigrateCommentTypeTest.php
+4
-2
core/modules/contact/src/Tests/Migrate/d6/MigrateContactCategoryTest.php
...ntact/src/Tests/Migrate/d6/MigrateContactCategoryTest.php
+2
-4
core/modules/contact/src/Tests/Migrate/d6/MigrateContactConfigsTest.php
...ontact/src/Tests/Migrate/d6/MigrateContactConfigsTest.php
+3
-13
core/modules/dblog/src/Tests/Migrate/d6/MigrateDblogConfigsTest.php
...es/dblog/src/Tests/Migrate/d6/MigrateDblogConfigsTest.php
+2
-4
core/modules/field/src/Tests/Migrate/d6/MigrateFieldFormatterSettingsTest.php
...rc/Tests/Migrate/d6/MigrateFieldFormatterSettingsTest.php
+15
-55
core/modules/field/src/Tests/Migrate/d6/MigrateFieldInstanceTest.php
...s/field/src/Tests/Migrate/d6/MigrateFieldInstanceTest.php
+3
-74
core/modules/field/src/Tests/Migrate/d6/MigrateFieldTest.php
core/modules/field/src/Tests/Migrate/d6/MigrateFieldTest.php
+0
-8
core/modules/field/src/Tests/Migrate/d6/MigrateFieldWidgetSettingsTest.php
...d/src/Tests/Migrate/d6/MigrateFieldWidgetSettingsTest.php
+3
-43
core/modules/field/src/Tests/Migrate/d7/MigrateFieldFormatterSettingsTest.php
...rc/Tests/Migrate/d7/MigrateFieldFormatterSettingsTest.php
+6
-4
core/modules/field/src/Tests/Migrate/d7/MigrateFieldInstanceTest.php
...s/field/src/Tests/Migrate/d7/MigrateFieldInstanceTest.php
+1
-2
core/modules/field/src/Tests/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php
...sts/Migrate/d7/MigrateFieldInstanceWidgetSettingsTest.php
+7
-5
core/modules/file/src/Tests/Migrate/d6/MigrateFileConfigsTest.php
...ules/file/src/Tests/Migrate/d6/MigrateFileConfigsTest.php
+0
-7
core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php
core/modules/file/src/Tests/Migrate/d6/MigrateFileTest.php
+6
-16
core/modules/file/src/Tests/Migrate/d6/MigrateUploadBase.php
core/modules/file/src/Tests/Migrate/d6/MigrateUploadBase.php
+0
-100
core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityDisplayTest.php
...e/src/Tests/Migrate/d6/MigrateUploadEntityDisplayTest.php
+7
-22
core/modules/file/src/Tests/Migrate/d6/MigrateUploadEntityFormDisplayTest.php
...c/Tests/Migrate/d6/MigrateUploadEntityFormDisplayTest.php
+7
-22
core/modules/file/src/Tests/Migrate/d6/MigrateUploadFieldTest.php
...ules/file/src/Tests/Migrate/d6/MigrateUploadFieldTest.php
+3
-9
core/modules/file/src/Tests/Migrate/d6/MigrateUploadInstanceTest.php
...s/file/src/Tests/Migrate/d6/MigrateUploadInstanceTest.php
+3
-31
core/modules/file/src/Tests/Migrate/d6/MigrateUploadTest.php
core/modules/file/src/Tests/Migrate/d6/MigrateUploadTest.php
+36
-12
core/modules/filter/src/Tests/Migrate/d6/MigrateFilterFormatTest.php
...s/filter/src/Tests/Migrate/d6/MigrateFilterFormatTest.php
+4
-2
core/modules/forum/src/Tests/Migrate/d6/MigrateForumConfigsTest.php
...es/forum/src/Tests/Migrate/d6/MigrateForumConfigsTest.php
+2
-8
core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php
...ules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php
+3
-11
core/modules/locale/src/Tests/Migrate/MigrateLocaleConfigsTest.php
...les/locale/src/Tests/Migrate/MigrateLocaleConfigsTest.php
+1
-3
core/modules/menu_link_content/src/Tests/Migrate/d6/MigrateMenuLinkTest.php
...link_content/src/Tests/Migrate/d6/MigrateMenuLinkTest.php
+3
-6
core/modules/menu_link_content/src/Tests/Migrate/d7/MigrateMenuLinkTest.php
...link_content/src/Tests/Migrate/d7/MigrateMenuLinkTest.php
+1
-3
core/modules/migrate/src/Plugin/migrate/source/DummyQueryTrait.php
...les/migrate/src/Plugin/migrate/source/DummyQueryTrait.php
+8
-1
core/modules/migrate/src/Tests/MigrateTestBase.php
core/modules/migrate/src/Tests/MigrateTestBase.php
+11
-0
core/modules/migrate_drupal/src/Tests/MigrateDrupalTestBase.php
...odules/migrate_drupal/src/Tests/MigrateDrupalTestBase.php
+3
-2
core/modules/migrate_drupal/src/Tests/MigrateFullDrupalTestBase.php
...es/migrate_drupal/src/Tests/MigrateFullDrupalTestBase.php
+0
-103
core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php
...odules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php
+0
-217
core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6TestBase.php
...es/migrate_drupal/src/Tests/d6/MigrateDrupal6TestBase.php
+105
-0
core/modules/migrate_drupal/src/Tests/dependencies/MigrateDependenciesTest.php
...drupal/src/Tests/dependencies/MigrateDependenciesTest.php
+5
-2
core/modules/node/src/Tests/Migrate/d6/MigrateNodeBuilderTest.php
...ules/node/src/Tests/Migrate/d6/MigrateNodeBuilderTest.php
+0
-2
core/modules/node/src/Tests/Migrate/d6/MigrateNodeBundleSettingsTest.php
...de/src/Tests/Migrate/d6/MigrateNodeBundleSettingsTest.php
+17
-40
core/modules/node/src/Tests/Migrate/d6/MigrateNodeConfigsTest.php
...ules/node/src/Tests/Migrate/d6/MigrateNodeConfigsTest.php
+0
-7
core/modules/node/src/Tests/Migrate/d6/MigrateNodeRevisionTest.php
...les/node/src/Tests/Migrate/d6/MigrateNodeRevisionTest.php
+1
-19
core/modules/node/src/Tests/Migrate/d6/MigrateNodeTest.php
core/modules/node/src/Tests/Migrate/d6/MigrateNodeTest.php
+1
-14
core/modules/node/src/Tests/Migrate/d6/MigrateNodeTestBase.php
...modules/node/src/Tests/Migrate/d6/MigrateNodeTestBase.php
+4
-61
core/modules/node/src/Tests/Migrate/d6/MigrateNodeTypeTest.php
...modules/node/src/Tests/Migrate/d6/MigrateNodeTypeTest.php
+6
-12
core/modules/node/src/Tests/Migrate/d6/MigrateViewModesTest.php
...odules/node/src/Tests/Migrate/d6/MigrateViewModesTest.php
+3
-9
core/modules/node/src/Tests/Migrate/d7/MigrateNodeTest.php
core/modules/node/src/Tests/Migrate/d7/MigrateNodeTest.php
+9
-7
core/modules/node/src/Tests/Migrate/d7/MigrateNodeTitleLabelTest.php
...s/node/src/Tests/Migrate/d7/MigrateNodeTitleLabelTest.php
+1
-2
core/modules/path/src/Tests/Migrate/d6/MigrateUrlAliasTest.php
...modules/path/src/Tests/Migrate/d6/MigrateUrlAliasTest.php
+11
-11
core/modules/path/src/Tests/Migrate/d7/MigrateUrlAliasTest.php
...modules/path/src/Tests/Migrate/d7/MigrateUrlAliasTest.php
+1
-3
core/modules/search/src/Tests/Migrate/d6/MigrateSearchPageTest.php
...les/search/src/Tests/Migrate/d6/MigrateSearchPageTest.php
+9
-10
core/modules/search/src/Tests/Migrate/d6/MigrateSearchSettingsTest.php
...search/src/Tests/Migrate/d6/MigrateSearchSettingsTest.php
+2
-4
core/modules/simpletest/src/Tests/Migrate/d6/MigrateSimpletestConfigsTest.php
...est/src/Tests/Migrate/d6/MigrateSimpletestConfigsTest.php
+1
-4
core/modules/statistics/src/Tests/Migrate/d6/MigrateStatisticsConfigsTest.php
...ics/src/Tests/Migrate/d6/MigrateStatisticsConfigsTest.php
+1
-3
core/modules/syslog/src/Tests/Migrate/d6/MigrateSyslogConfigsTest.php
.../syslog/src/Tests/Migrate/d6/MigrateSyslogConfigsTest.php
+1
-3
core/modules/system/src/Tests/Migrate/MigrateMenuTest.php
core/modules/system/src/Tests/Migrate/MigrateMenuTest.php
+3
-1
No files found.
core/modules/action/src/Tests/Migrate/d6/MigrateActionConfigsTest.php
View file @
8477f6b7
...
...
@@ -20,11 +20,9 @@ class MigrateActionConfigsTest extends MigrateDrupal6TestBase {
use
SchemaCheckTestTrait
;
/**
* Modules to enable.
*
* @var array
* {@inheritdoc}
*/
public
static
$modules
=
array
(
'action'
)
;
public
static
$modules
=
[
'action'
]
;
/**
* {@inheritdoc}
...
...
core/modules/aggregator/src/Tests/Migrate/d6/MigrateAggregatorConfigsTest.php
View file @
8477f6b7
...
...
@@ -20,11 +20,9 @@ class MigrateAggregatorConfigsTest extends MigrateDrupal6TestBase {
use
SchemaCheckTestTrait
;
/**
* Modules to enable.
*
* @var array
* {@inheritdoc}
*/
public
static
$modules
=
array
(
'aggregator'
)
;
public
static
$modules
=
[
'aggregator'
]
;
/**
* {@inheritdoc}
...
...
core/modules/aggregator/src/Tests/Migrate/d6/MigrateAggregatorFeedTest.php
View file @
8477f6b7
...
...
@@ -17,7 +17,10 @@
*/
class
MigrateAggregatorFeedTest
extends
MigrateDrupal6TestBase
{
static
$modules
=
array
(
'aggregator'
);
/**
* {@inheritdoc}
*/
public
static
$modules
=
[
'aggregator'
];
/**
* {@inheritdoc}
...
...
core/modules/aggregator/src/Tests/Migrate/d6/MigrateAggregatorItemTest.php
View file @
8477f6b7
...
...
@@ -17,7 +17,10 @@
*/
class
MigrateAggregatorItemTest
extends
MigrateDrupal6TestBase
{
static
$modules
=
array
(
'aggregator'
);
/**
* {@inheritdoc}
*/
public
static
$modules
=
[
'aggregator'
];
/**
* {@inheritdoc}
...
...
@@ -26,26 +29,7 @@ protected function setUp() {
parent
::
setUp
();
$this
->
installEntitySchema
(
'aggregator_feed'
);
$this
->
installEntitySchema
(
'aggregator_item'
);
// Add some id mappings for the dependant migrations.
$id_mappings
=
array
(
'd6_aggregator_feed'
=>
array
(
array
(
array
(
5
),
array
(
5
)),
),
);
$this
->
prepareMigrations
(
$id_mappings
);
$entity
=
entity_create
(
'aggregator_feed'
,
array
(
'fid'
=>
5
,
'title'
=>
'Drupal Core'
,
'url'
=>
'https://groups.drupal.org/not_used/167169'
,
'refresh'
=>
900
,
'checked'
=>
1389919932
,
'description'
=>
'Drupal Core Group feed'
,
));
$entity
->
enforceIsNew
();
$entity
->
save
();
$this
->
executeMigration
(
'd6_aggregator_item'
);
$this
->
executeMigrations
([
'd6_aggregator_feed'
,
'd6_aggregator_item'
]);
}
/**
...
...
core/modules/block/src/Tests/Migrate/d6/MigrateBlockTest.php
View file @
8477f6b7
...
...
@@ -18,50 +18,24 @@
class
MigrateBlockTest
extends
MigrateDrupal6TestBase
{
/**
* Modules to enable.
*
* @var array
* {@inheritdoc}
*/
static
$modules
=
array
(
public
static
$modules
=
[
'block'
,
'views'
,
'comment'
,
'menu_ui'
,
'block_content'
,
'node'
,
);
];
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
installConfig
([
'block_content'
]);
$this
->
installEntitySchema
(
'block_content'
);
$entities
=
array
(
entity_create
(
'menu'
,
array
(
'id'
=>
'primary-links'
)),
entity_create
(
'menu'
,
array
(
'id'
=>
'secondary-links'
)),
entity_create
(
'block_content'
,
array
(
'id'
=>
1
,
'type'
=>
'basic'
,
'info'
=>
$this
->
randomMachineName
(
8
))),
entity_create
(
'block_content'
,
array
(
'id'
=>
2
,
'type'
=>
'basic'
,
'info'
=>
$this
->
randomMachineName
(
8
))),
);
foreach
(
$entities
as
$entity
)
{
$entity
->
enforceIsNew
(
TRUE
);
$entity
->
save
();
}
$this
->
prepareMigrations
(
array
(
'd6_custom_block'
=>
array
(
array
(
array
(
1
),
array
(
1
)),
array
(
array
(
2
),
array
(
2
)),
),
'menu'
=>
array
(
array
(
array
(
'menu1'
),
array
(
'menu'
)),
),
'd6_user_role'
=>
array
(
array
(
array
(
2
),
array
(
'authenticated'
)),
array
(
array
(
3
),
array
(
'migrate_test_role_1'
)),
),
));
// Set Bartik and Seven as the default public and admin theme.
$config
=
$this
->
config
(
'system.theme'
);
$config
->
set
(
'default'
,
'bartik'
);
...
...
@@ -69,9 +43,17 @@ protected function setUp() {
$config
->
save
();
// Install one of D8's test themes.
\
Drupal
::
service
(
'theme_handler'
)
->
install
(
array
(
'test_theme'
));
$this
->
executeMigration
(
'd6_block'
);
\
Drupal
::
service
(
'theme_handler'
)
->
install
([
'test_theme'
]);
$this
->
executeMigrations
([
'd6_filter_format'
,
'block_content_type'
,
'block_content_body_field'
,
'd6_custom_block'
,
'menu'
,
'd6_user_role'
,
'd6_block'
,
]);
}
/**
...
...
core/modules/block/src/Tests/Migrate/d7/MigrateBlockTest.php
View file @
8477f6b7
...
...
@@ -18,10 +18,8 @@
*/
class
MigrateBlockTest
extends
MigrateDrupal7TestBase
{
/**
* Modules to enable.
*
* @var array
/**
* {@inheritdoc}
*/
static
$modules
=
[
'block'
,
...
...
@@ -52,12 +50,14 @@ protected function setUp() {
// Install one of D8's test themes.
\
Drupal
::
service
(
'theme_handler'
)
->
install
([
'bartik'
]);
$this
->
executeMigration
(
'd7_filter_format'
);
$this
->
executeMigration
(
'd7_user_role'
);
$this
->
executeMigration
(
'block_content_type'
);
$this
->
executeMigration
(
'block_content_body_field'
);
$this
->
executeMigration
(
'd7_custom_block'
);
$this
->
executeMigration
(
'd7_block'
);
$this
->
executeMigrations
([
'd7_filter_format'
,
'd7_user_role'
,
'block_content_type'
,
'block_content_body_field'
,
'd7_custom_block'
,
'd7_block'
,
]);
}
/**
...
...
core/modules/block_content/src/Tests/Migrate/MigrateBlockContentBodyFieldTest.php
View file @
8477f6b7
...
...
@@ -29,8 +29,10 @@ protected function setUp() {
parent
::
setUp
();
$this
->
installConfig
([
'block_content'
]);
$this
->
installEntitySchema
(
'block_content'
);
$this
->
executeMigration
(
'block_content_type'
);
$this
->
executeMigration
(
'block_content_body_field'
);
$this
->
executeMigrations
([
'block_content_type'
,
'block_content_body_field'
,
]);
}
/**
...
...
core/modules/block_content/src/Tests/Migrate/d6/MigrateBlockContentTest.php
View file @
8477f6b7
...
...
@@ -17,25 +17,25 @@
*/
class
MigrateBlockContentTest
extends
MigrateDrupal6TestBase
{
static
$modules
=
array
(
'block'
,
'block_content'
,
'filter'
,
'text'
);
/**
* {@inheritdoc}
*/
public
static
$modules
=
[
'block'
,
'block_content'
];
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
installConfig
(
array
(
'block_content'
)
);
$this
->
installConfig
(
[
'block_content'
]
);
$this
->
installEntitySchema
(
'block_content'
);
$this
->
executeMigration
(
'block_content_type'
);
$this
->
executeMigration
(
'block_content_body_field'
);
$this
->
prepareMigrations
(
array
(
'd6_filter_format'
=>
array
(
array
(
array
(
2
),
array
(
'full_html'
))
)
));
$this
->
executeMigration
(
'd6_custom_block'
);
$this
->
executeMigrations
([
'd6_filter_format'
,
'block_content_type'
,
'block_content_body_field'
,
'd6_custom_block'
,
]);
}
/**
...
...
core/modules/block_content/src/Tests/Migrate/d7/MigrateCustomBlockTest.php
View file @
8477f6b7
...
...
@@ -32,10 +32,12 @@ protected function setUp() {
$this
->
installConfig
(
static
::
$modules
);
$this
->
installEntitySchema
(
'block_content'
);
$this
->
executeMigration
(
'd7_filter_format'
);
$this
->
executeMigration
(
'block_content_type'
);
$this
->
executeMigration
(
'block_content_body_field'
);
$this
->
executeMigration
(
'd7_custom_block'
);
$this
->
executeMigrations
([
'd7_filter_format'
,
'block_content_type'
,
'block_content_body_field'
,
'd7_custom_block'
,
]);
}
/**
...
...
core/modules/book/src/Tests/Migrate/d6/MigrateBookConfigsTest.php
View file @
8477f6b7
...
...
@@ -20,11 +20,9 @@ class MigrateBookConfigsTest extends MigrateDrupal6TestBase {
use
SchemaCheckTestTrait
;
/**
* Modules to enable.
*
* @var array
* {@inheritdoc}
*/
public
static
$modules
=
array
(
'book'
,
'system'
,
'node'
,
'field'
,
'text'
,
'entity_reference'
)
;
public
static
$modules
=
[
'book'
]
;
/**
* {@inheritdoc}
...
...
core/modules/book/src/Tests/Migrate/d6/MigrateBookTest.php
View file @
8477f6b7
...
...
@@ -17,39 +17,19 @@
*/
class
MigrateBookTest
extends
MigrateDrupal6TestBase
{
public
static
$modules
=
array
(
'book'
,
'system'
,
'node'
,
'field'
,
'text'
,
'entity_reference'
,
'user'
);
/**
* {@inheritdoc}
*/
public
static
$modules
=
[
'book'
];
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
installEntitySchema
(
'node'
);
$this
->
installSchema
(
'book'
,
array
(
'book'
));
$this
->
installSchema
(
'node'
,
array
(
'node_access'
));
// Create a default bogus mapping for all variants of d6_node.
$id_mappings
=
array
(
'd6_node:*'
=>
array
(
array
(
array
(
0
),
array
(
0
),
),
),
);
for
(
$i
=
4
;
$i
<=
8
;
$i
++
)
{
$entity
=
entity_create
(
'node'
,
array
(
'type'
=>
'story'
,
'title'
=>
"Node
$i
"
,
'nid'
=>
$i
,
'status'
=>
TRUE
,
));
$entity
->
enforceIsNew
();
$entity
->
save
();
$id_mappings
[
'd6_node__story'
][]
=
array
(
array
(
$i
),
array
(
$i
));
}
$this
->
prepareMigrations
(
$id_mappings
);
$this
->
installSchema
(
'book'
,
[
'book'
]);
$this
->
installSchema
(
'node'
,
[
'node_access'
]);
$this
->
migrateContent
();
$this
->
executeMigration
(
'd6_book'
);
}
...
...
core/modules/comment/src/Tests/Migrate/d6/MigrateCommentTest.php
View file @
8477f6b7
...
...
@@ -19,10 +19,16 @@ class MigrateCommentTest extends MigrateDrupal6TestBase {
use
CommentTestTrait
;
// Directly testing that comments' entity_id is populated upon importing is
// not straightforward, but RDF module serves as an implicit test -
// its hook_comment_storage_load() references a stubbed comment.
static
$modules
=
[
'node'
,
'comment'
,
'text'
,
'filter'
,
'rdf'
];
/**
* {@inheritdoc}
*/
public
static
$modules
=
[
'comment'
,
// Directly testing that a stub comment's entity_id is populated upon
// importing is not straightforward, but RDF module serves as an implicit
// test - its hook_comment_storage_load() references a stubbed comment.
'rdf'
,
];
/**
* {@inheritdoc}
...
...
@@ -34,38 +40,20 @@ protected function setUp() {
$this
->
installEntitySchema
(
'comment'
);
$this
->
installSchema
(
'comment'
,
[
'comment_entity_statistics'
]);
$this
->
installSchema
(
'system'
,
[
'router'
]);
$this
->
installConfig
([
'node'
,
'comment'
]);
$this
->
installConfig
([
'comment'
]);
// The entity.node.canonical route must exist when the RDF hook is called.
$this
->
container
->
get
(
'router.builder'
)
->
rebuild
();
entity_create
(
'node_type'
,
array
(
'type'
=>
'page'
))
->
save
();
entity_create
(
'node_type'
,
array
(
'type'
=>
'story'
))
->
save
();
$this
->
addDefaultCommentField
(
'node'
,
'story'
);
$this
->
container
->
get
(
'entity.manager'
)
->
getStorage
(
'comment_type'
)
->
create
(
array
(
'id'
=>
'comment_no_subject'
,
'label'
=>
'comment_no_subject'
,
'target_entity_type_id'
=>
'node'
,
))
->
save
();
\
Drupal
::
service
(
'comment.manager'
)
->
addBodyField
(
'comment_no_subject'
);
$node
=
entity_create
(
'node'
,
array
(
'type'
=>
'story'
,
'nid'
=>
1
,
'title'
=>
$this
->
randomString
(),
));
$node
->
enforceIsNew
();
$node
->
save
();
$id_mappings
=
array
(
'd6_filter_format'
=>
array
(
array
(
array
(
1
),
array
(
'filtered_html'
))),
'd6_node:*'
=>
array
(
array
(
array
(
1
),
array
(
1
))),
'd6_user'
=>
array
(
array
(
array
(
0
),
array
(
0
))),
'd6_comment_type'
=>
array
(
array
(
array
(
'comment'
),
array
(
'comment_no_subject'
))),
'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
->
prepareMigrations
(
$id_mappings
);
$this
->
executeMigration
(
'd6_comment'
);
$this
->
migrateContent
();
$this
->
executeMigrations
([
'd6_comment_type'
,
'd6_comment_field'
,
'd6_comment_field_instance'
,
'd6_comment_entity_display'
,
'd6_comment_entity_form_display'
,
'd6_comment'
,
]);
}
/**
...
...
core/modules/comment/src/Tests/Migrate/d6/MigrateCommentTypeTest.php
View file @
8477f6b7
...
...
@@ -17,7 +17,10 @@
*/
class
MigrateCommentTypeTest
extends
MigrateDrupal6TestBase
{
static
$modules
=
array
(
'node'
,
'comment'
,
'text'
,
'filter'
);
/**
* {@inheritdoc}
*/
public
static
$modules
=
[
'comment'
];
/**
* {@inheritdoc}
...
...
core/modules/comment/src/Tests/Migrate/d6/MigrateCommentVariableDisplayBase.php
View file @
8477f6b7
...
...
@@ -15,57 +15,22 @@
abstract
class
MigrateCommentVariableDisplayBase
extends
MigrateDrupal6TestBase
{
/**
* The ID of migration to run.
*
* This constant needs to be set in the concrete class in order for the test
* to work.
*/
const
MIGRATION
=
''
;
/**
* Modules to enable.
*
* @var array
*/
static
$modules
=
array
(
'comment'
,
'node'
);
/**
* The node types being tested.
*
* @var array
* {@inheritdoc}
*/
p
rotected
$types
=
array
(
'page'
,
'story'
,
'article'
)
;
p
ublic
static
$modules
=
[
'comment'
]
;
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
parent
::
setUp
();
entity_create
(
'field_storage_config'
,
array
(
'entity_type'
=>
'node'
,
'field_name'
=>
'comment'
,
'type'
=>
'comment'
,
'translatable'
=>
'0'
,
))
->
save
();
foreach
(
$this
->
types
as
$type
)
{
entity_create
(
'node_type'
,
array
(
'type'
=>
$type
))
->
save
();
entity_create
(
'field_config'
,
array
(
'label'
=>
'Comments'
,
'description'
=>
''
,
'field_name'
=>
'comment'
,
'entity_type'
=>
'node'
,
'bundle'
=>
$type
,
'required'
=>
1
,
))
->
save
();
}
$id_mappings
=
array
(
'd6_comment_field_instance'
=>
array
(
array
(
array
(
'page'
),
array
(
'node'
,
'comment'
,
'page'
)),
),
);
$this
->
prepareMigrations
(
$id_mappings
);
$this
->
executeMigration
(
static
::
MIGRATION
);
$this
->
installConfig
([
'comment'
]);
$this
->
migrateContentTypes
();
$this
->
executeMigrations
([
'd6_comment_type'
,
'd6_comment_field'
,
'd6_comment_field_instance'
,
]);
}
}
core/modules/comment/src/Tests/Migrate/d6/MigrateCommentVariableEntityDisplayTest.php
View file @
8477f6b7
...
...
@@ -7,6 +7,8 @@
namespace
Drupal\comment\Tests\Migrate\d6
;
use
Drupal\Core\Entity\Entity\EntityViewDisplay
;
/**
* Upgrade comment variables to entity.display.node.*.default.yml.
*
...
...
@@ -15,21 +17,19 @@
class
MigrateCommentVariableEntityDisplayTest
extends
MigrateCommentVariableDisplayBase
{
/**
*
The migration to run.
*
{@inheritdoc}
*/
const
MIGRATION
=
'd6_comment_entity_display'
;
/**
* The node types being used.
*/
protected
$types
=
array
(
'page'
,
'story'
,
'article'
);
protected
function
setUp
()
{
parent
::
setUp
();
$this
->
executeMigration
(
'd6_comment_entity_display'
);
}
/**
* Tests comment variables migrated into an entity display.
*/
public
function
testCommentEntityDisplay
()
{
foreach
(
$this
->
types
as
$type
)
{
$component
=
e
ntity
_get_display
(
'node
'
,
$type
,
'default'
)
->
getComponent
(
'comment'
);
foreach
(
[
'page'
,
'story'
,
'article'
]
as
$type
)
{
$component
=
E
ntity
ViewDisplay
::
load
(
'node
.'
.
$type
.
'
.
default'
)
->
getComponent
(
'comment'
);
$this
->
assertIdentical
(
'hidden'
,
$component
[
'label'
]);
$this
->
assertIdentical
(
'comment_default'
,
$component
[
'type'
]);
$this
->
assertIdentical
(
20
,
$component
[
'weight'
]);
...
...
core/modules/comment/src/Tests/Migrate/d6/MigrateCommentVariableEntityFormDisplaySubjectTest.php
View file @
8477f6b7
...
...
@@ -7,6 +7,7 @@
namespace
Drupal\comment\Tests\Migrate\d6
;
use
Drupal\Core\Entity\Entity\EntityFormDisplay
;
use
Drupal\migrate_drupal
\
Tests\d6\MigrateDrupal6TestBase
;
/**
...
...
@@ -17,43 +18,31 @@
class
MigrateCommentVariableEntityFormDisplaySubjectTest
extends
MigrateDrupal6TestBase
{
/**
* Modules to enable.
*
* @var array
* {@inheritdoc}
*/
public
static
$modules
=
array
(
'comment'
,
'node'
)
;
public
static
$modules
=
[
'comment'
]
;
/**
* {@inheritdoc}
*/
protected
function
setUp
()
{
parent
::
setUp
();
foreach
([
'comment'
,
'comment_no_subject'
]
as
$comment_type
)
{
entity_create
(
'comment_type'
,
array
(
'id'
=>
$comment_type
,
'target_entity_type_id'
=>
'node'
,
))
->
save
();
}
// Add some id mappings for the dependant migrations.
$id_mappings
=
array
(
'd6_comment_type'
=>
array
(
array
(
array
(
'comment'
),
array
(
'comment_no_subject'
)),
),
);
$this
->
prepareMigrations
(
$id_mappings
);
$this
->
executeMigration
(
'd6_comment_entity_form_display_subject'
);
$this
->
installConfig
([
'comment'
]);
$this
->
executeMigrations
([
'd6_comment_type'
,
'd6_comment_entity_form_display_subject'
,
]);
}