diff --git a/core/modules/migrate_drupal/src/Tests/Table/d7/Variable.php b/core/modules/migrate_drupal/src/Tests/Table/d7/Variable.php index cef570e..1225737 100644 --- a/core/modules/migrate_drupal/src/Tests/Table/d7/Variable.php +++ b/core/modules/migrate_drupal/src/Tests/Table/d7/Variable.php @@ -329,6 +329,15 @@ public function load() { 'name' => 'site_slogan', 'value' => 's:10:"The Slogan";', ))->values(array( + 'name' => 'statistics_block_top_all_num', + 'value' => 'i:55;', + ))->values(array( + 'name' => 'statistics_block_top_day_num', + 'value' => 'i:30;', + ))->values(array( + 'name' => 'statistics_block_top_last_num', + 'value' => 'i:9;', + ))->values(array( 'name' => 'statistics_count_content_views', 'value' => 'i:1;', ))->values(array( @@ -470,4 +479,4 @@ public function load() { } } -#e0f7be890a222531c707941d0fedf479 +#9023663998fea3fa823d287d8a53ab9f diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php index ac5a836..8ce97bb 100644 --- a/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php @@ -117,7 +117,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase { 'd6_search_page', 'd6_search_settings', 'd6_simpletest_settings', - 'd6_statistics_settings', + 'statistics_settings', 'd6_syslog_settings', 'd6_system_cron', 'd6_system_file', diff --git a/core/modules/statistics/migration_templates/statistics_popular_block_settings.yml b/core/modules/statistics/migration_templates/statistics_popular_block_settings.yml new file mode 100644 index 0000000..46a9ab2 --- /dev/null +++ b/core/modules/statistics/migration_templates/statistics_popular_block_settings.yml @@ -0,0 +1,18 @@ +id: statistics_popular_block_settings +label: Statistics popular block configuration +migration_tags: + - Drupal 6 + - Drupal 7 +source: + plugin: variable + variables: + - statistics_block_top_day_num + - statistics_block_top_all_num + - statistics_block_top_last_num +process: + top_day_num: statistics_block_top_day_num + top_all_num: statistics_block_top_all_num + top_last_num: statistics_block_top_last_num +destination: + plugin: config + config_name: block.settings.statistics_popular_block diff --git a/core/modules/statistics/migration_templates/d6_statistics_settings.yml b/core/modules/statistics/migration_templates/statistics_settings.yml similarity index 86% rename from core/modules/statistics/migration_templates/d6_statistics_settings.yml rename to core/modules/statistics/migration_templates/statistics_settings.yml index a8820db..62c2c06 100644 --- a/core/modules/statistics/migration_templates/d6_statistics_settings.yml +++ b/core/modules/statistics/migration_templates/statistics_settings.yml @@ -1,7 +1,8 @@ -id: d6_statistics_settings -label: Drupal 6 statistics configuration +id: statistics_settings +label: Statistics configuration migration_tags: - Drupal 6 + - Drupal 7 source: plugin: variable variables: diff --git a/core/modules/statistics/src/Tests/Migrate/d6/MigrateStatisticsConfigsTest.php b/core/modules/statistics/src/Tests/Migrate/MigrateStatisticsConfigsTest.php similarity index 85% rename from core/modules/statistics/src/Tests/Migrate/d6/MigrateStatisticsConfigsTest.php rename to core/modules/statistics/src/Tests/Migrate/MigrateStatisticsConfigsTest.php index ea0be9d..d5922e1 100644 --- a/core/modules/statistics/src/Tests/Migrate/d6/MigrateStatisticsConfigsTest.php +++ b/core/modules/statistics/src/Tests/Migrate/MigrateStatisticsConfigsTest.php @@ -2,10 +2,10 @@ /** * @file - * Contains \Drupal\statistics\Tests\Migrate\d6\MigrateStatisticsConfigsTest. + * Contains \Drupal\statistics\Tests\Migrate\MigrateStatisticsConfigsTest. */ -namespace Drupal\statistics\Tests\Migrate\d6; +namespace Drupal\statistics\Tests\Migrate; use Drupal\config\Tests\SchemaCheckTestTrait; use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase; @@ -32,7 +32,7 @@ class MigrateStatisticsConfigsTest extends MigrateDrupal6TestBase { protected function setUp() { parent::setUp(); $this->loadDumps(['Variable.php']); - $this->executeMigration('d6_statistics_settings'); + $this->executeMigration('statistics_settings'); } /** diff --git a/core/modules/statistics/src/Tests/Migrate/MigrateStatisticsPopularBlockSettingsTest.php b/core/modules/statistics/src/Tests/Migrate/MigrateStatisticsPopularBlockSettingsTest.php new file mode 100644 index 0000000..fe7b6b3 --- /dev/null +++ b/core/modules/statistics/src/Tests/Migrate/MigrateStatisticsPopularBlockSettingsTest.php @@ -0,0 +1,45 @@ +installConfig(['statistics']); + $this->loadDumps(['Variable.php']); + $this->executeMigration('statistics_popular_block_settings'); + } + + /** + * Tests migration of Popular block settings into configuration. + */ + public function testMigration() { + $config = \Drupal::config('block.settings.statistics_popular_block')->get(); + $this->assertIdentical(55, $config['top_all_num']); + $this->assertIdentical(30, $config['top_day_num']); + $this->assertIdentical(9, $config['top_last_num']); + $this->assertConfigSchema(\Drupal::service('config.typed'), 'block.settings.statistics_popular_block', $config); + } + +}