Commit 133dcccb authored by alexpott's avatar alexpott

Issue #2422229 by quietone, ultimike, vprocessor, anish.a, Jo Fitzgerald,...

Issue #2422229 by quietone, ultimike, vprocessor, anish.a, Jo Fitzgerald, phenaproxima: D6->D8 Core block migrations missing settings tests
parent a0dcc7f1
......@@ -33,7 +33,7 @@ protected function setUp() {
public function testBookSettings() {
$config = $this->config('book.settings');
$this->assertIdentical('book', $config->get('child_type'));
$this->assertIdentical('all pages', $config->get('block.navigation.mode'));
$this->assertSame('book pages', $config->get('block.navigation.mode'));
$this->assertIdentical(['book'], $config->get('allowed_types'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'book.settings', $config->get());
}
......
......@@ -38,9 +38,9 @@ public function testForumSettings() {
$this->assertIdentical(1, $config->get('topics.order'));
$this->assertIdentical('vocabulary_1_i_0_', $config->get('vocabulary'));
// This is 'forum_block_num_0' in D6, but block:active:limit' in D8.
$this->assertIdentical(5, $config->get('block.active.limit'));
$this->assertSame(3, $config->get('block.active.limit'));
// This is 'forum_block_num_1' in D6, but 'block:new:limit' in D8.
$this->assertIdentical(5, $config->get('block.new.limit'));
$this->assertSame(4, $config->get('block.new.limit'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'forum.settings', $config->get());
}
......
......@@ -33,17 +33,18 @@ public function testMigrateDependenciesOrder() {
'd6_node:company',
'd6_node:employee',
'd6_node:event',
'd6_node:forum',
'd6_node:page',
'd6_user',
'd6_node_type',
'd6_node_settings',
'd6_filter_format',
'd6_node:sponsor',
'd6_node:story',
'd6_node:test_event',
'd6_node:test_page',
'd6_node:test_planet',
'd6_node:test_story',
'd6_node_type',
'd6_node_settings',
'd6_filter_format',
'd6_user',
'd6_comment_type',
'd6_comment_entity_display',
'd6_comment_entity_form_display',
......
......@@ -426,7 +426,7 @@ class MigrateUpgradeForm extends ConfirmFormBase {
'source_module' => 'simpletest',
'destination_module' => 'simpletest',
],
'd6_statistics_settings' => [
'statistics_settings' => [
'source_module' => 'statistics',
'destination_module' => 'statistics',
],
......
......@@ -30,7 +30,16 @@ abstract class MigrateUpgradeTestBase extends WebTestBase {
*
* @var array
*/
public static $modules = ['language', 'content_translation', 'migrate_drupal_ui', 'telephone'];
public static $modules = [
'language',
'content_translation',
'migrate_drupal_ui',
'telephone',
'aggregator',
'book',
'forum',
'statistics',
];
/**
* {@inheritdoc}
......@@ -143,8 +152,9 @@ public function testMigrateUpgrade() {
$this->resetAll();
$expected_counts = $this->getEntityCounts();
foreach (array_keys(\Drupal::entityTypeManager()->getDefinitions()) as $entity_type) {
$real_count = count(\Drupal::entityTypeManager()->getStorage($entity_type)->loadMultiple());
foreach (array_keys(\Drupal::entityTypeManager()
->getDefinitions()) as $entity_type) {
$real_count = \Drupal::entityQuery($entity_type)->count()->execute();
$expected_count = isset($expected_counts[$entity_type]) ? $expected_counts[$entity_type] : 0;
$this->assertEqual($expected_count, $real_count, "Found $real_count $entity_type entities, expected $expected_count.");
}
......
......@@ -34,42 +34,44 @@ protected function getSourceBasePath() {
*/
protected function getEntityCounts() {
return [
'block' => 30,
'aggregator_item' => 1,
'aggregator_feed' => 1,
'block' => 35,
'block_content' => 2,
'block_content_type' => 1,
'comment' => 3,
'comment_type' => 2,
'comment_type' => 3,
'contact_form' => 5,
'configurable_language' => 5,
'editor' => 2,
'field_config' => 63,
'field_storage_config' => 43,
'field_config' => 71,
'field_storage_config' => 46,
'file' => 7,
'filter_format' => 7,
'image_style' => 5,
'language_content_settings' => 2,
'migration' => 105,
'node' => 11,
'node_type' => 11,
'rdf_mapping' => 5,
'node_type' => 13,
'rdf_mapping' => 7,
'search_page' => 2,
'shortcut' => 2,
'shortcut_set' => 1,
'action' => 22,
'menu' => 8,
'taxonomy_term' => 6,
'taxonomy_vocabulary' => 5,
'taxonomy_vocabulary' => 6,
'tour' => 4,
'user' => 7,
'user_role' => 6,
'menu_link_content' => 4,
'view' => 12,
'view' => 14,
'date_format' => 11,
'entity_form_display' => 15,
'entity_form_display' => 19,
'entity_form_mode' => 1,
'entity_view_display' => 32,
'entity_view_mode' => 12,
'base_field_override' => 33,
'entity_view_display' => 41,
'entity_view_mode' => 14,
'base_field_override' => 38,
];
}
......
......@@ -34,17 +34,19 @@ protected function getSourceBasePath() {
*/
protected function getEntityCounts() {
return [
'aggregator_item' => 10,
'aggregator_feed' => 1,
'block' => 25,
'block_content' => 1,
'block_content_type' => 1,
'comment' => 1,
'comment_type' => 7,
'comment_type' => 8,
// Module 'language' comes with 'en', 'und', 'zxx'. Migration adds 'is'.
'configurable_language' => 4,
'contact_form' => 3,
'editor' => 2,
'field_config' => 49,
'field_storage_config' => 37,
'field_config' => 52,
'field_storage_config' => 39,
'file' => 2,
'filter_format' => 7,
'image_style' => 6,
......@@ -52,7 +54,7 @@ protected function getEntityCounts() {
'migration' => 73,
'node' => 3,
'node_type' => 6,
'rdf_mapping' => 5,
'rdf_mapping' => 7,
'search_page' => 2,
'shortcut' => 6,
'shortcut_set' => 2,
......@@ -64,13 +66,13 @@ protected function getEntityCounts() {
'user' => 4,
'user_role' => 3,
'menu_link_content' => 7,
'view' => 12,
'view' => 14,
'date_format' => 11,
'entity_form_display' => 16,
'entity_form_display' => 18,
'entity_form_mode' => 1,
'entity_view_display' => 24,
'entity_view_mode' => 11,
'base_field_override' => 7,
'entity_view_display' => 29,
'entity_view_mode' => 14,
'base_field_override' => 9,
];
}
......
......@@ -32,7 +32,7 @@ protected function setUp() {
*/
public function testStatisticsSettings() {
$config = $this->config('statistics.settings');
$this->assertIdentical(0, $config->get('count_content_views'));
$this->assertSame(1, $config->get('count_content_views'));
$this->assertConfigSchema(\Drupal::service('config.typed'), 'statistics.settings', $config->get());
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment