3 namespace Drupal\Tests\system\Kernel\Migrate\d7;
5 use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
8 * Migrates various configuration objects owned by the System module.
10 * @group migrate_drupal_7
12 class MigrateSystemConfigurationTest extends MigrateDrupal7TestBase {
14 public static $modules = ['action', 'file', 'system'];
16 protected $expectedConfig = [
17 'system.authorize' => [
18 'filetransfer_default' => 'ftp',
22 // autorun is not handled by the migration.
24 'requirements_warning' => 172800,
25 'requirements_error' => 1209600,
35 'default' => 'America/Chicago',
37 'configurable' => TRUE,
39 // DRUPAL_USER_TIMEZONE_SELECT (D7 API)
45 'allow_insecure_uploads' => TRUE,
46 // default_scheme is not handled by the migration.
47 'default_scheme' => 'public',
49 'temporary' => '/tmp',
51 // temporary_maximum_age is not handled by the migration.
52 'temporary_maximum_age' => 21600,
54 'system.image.gd' => [
61 'error_level' => 'some',
65 'default' => 'php_mail',
68 'system.maintenance' => [
69 'message' => 'This is a custom maintenance mode message.',
70 // langcode is not handled by the migration.
73 'system.performance' => [
81 // gzip is not handled by the migration.
84 // fast_404 is not handled by the migration.
87 'paths' => '/\.(?:txt|png|gif|jpe?g|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i',
88 'exclude_paths' => '/\/(?:styles|imagecache)\//',
89 'html' => '<!DOCTYPE html><html><head><title>404 Not Found</title></head><body><h1>Not Found</h1><p>The requested URL "@path" was not found on this server.</p></body></html>',
92 'preprocess' => FALSE,
93 // gzip is not handled by the migration.
96 // stale_file_threshold is not handled by the migration.
97 'stale_file_threshold' => 2592000,
105 'view_mode' => 'fulltext',
110 // uuid is not handled by the migration.
112 'name' => 'The Site Name',
113 'mail' => 'joseph@flattandsons.com',
114 'slogan' => 'The Slogan',
120 'admin_compact_mode' => TRUE,
121 'weight_select_max' => 40,
122 // langcode and default_langcode are not handled by the migration.
124 'default_langcode' => 'en',
131 protected function setUp() {
135 'd7_system_authorize',
143 'system_maintenance',
144 'd7_system_performance',
148 $this->executeMigrations($migrations);
152 * Tests that all expected configuration gets migrated.
154 public function testConfigurationMigration() {
155 foreach ($this->expectedConfig as $config_id => $values) {
156 if ($config_id == 'system.mail') {
157 $actual = \Drupal::config($config_id)->getRawData();
160 $actual = \Drupal::config($config_id)->get();
162 unset($actual['_core']);
163 $this->assertSame($actual, $values, $config_id . ' matches expected values.');