diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_system_logging.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_system_logging.yml new file mode 100644 index 0000000..e59a3c1 --- /dev/null +++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_system_logging.yml @@ -0,0 +1,19 @@ +id: d6_system_logging +label: Drupal 6 system logging +source: + plugin: variable + variables: + - error_level +process: + error_level: + plugin: static_map + source: error_level + default_value: all + map: + 0: hide + 1: some + 2: all + 3: verbose +destination: + plugin: config + config_name: system.logging diff --git a/core/modules/migrate_drupal/src/Tests/Dump/Drupal6SystemLogging.php b/core/modules/migrate_drupal/src/Tests/Dump/Drupal6SystemLogging.php new file mode 100644 index 0000000..fcee55f --- /dev/null +++ b/core/modules/migrate_drupal/src/Tests/Dump/Drupal6SystemLogging.php @@ -0,0 +1,31 @@ +createTable('variable'); + $this->database->insert('variable')->fields(array( + 'name', + 'value', + )) + ->values(array( + 'name' => 'error_level', + 'value' => serialize(1), + )) + ->execute(); + } + +} diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemLoggingTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemLoggingTest.php new file mode 100644 index 0000000..fe475bb --- /dev/null +++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemLoggingTest.php @@ -0,0 +1,55 @@ + 'Migrate error_level variable to system.logging.yml', + 'description' => 'Upgrade error_level variable to system.logging.yml', + 'group' => 'Migrate Drupal', + ); + } + + /** + * {@inheritdoc} + */ + protected function setUp() { + parent::setUp(); + $migration = entity_load('migration', 'd6_system_logging'); + $dumps = array( + $this->getDumpDirectory() . '/Drupal6SystemLogging.php', + ); + $this->prepare($migration, $dumps); + $executable = new MigrateExecutable($migration, $this); + $executable->import(); + } + + /** + * Tests migration of system error_level variables to system.logging.yml. + */ + public function testSystemLogging() { + $config = \Drupal::config('system.logging'); + $this->assertIdentical($config->get('error_level'), 'some'); + $this->assertConfigSchema(\Drupal::service('config.typed'), 'system.logging', $config->get()); + } + +}