Skip to content

Commit 9291500

Browse files
author
Bohdan Korablov
committed
MAGETWO-65422: Write default configs to shared configuration file by app:config:dump
1 parent f1033b2 commit 9291500

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

app/code/Magento/Config/etc/di.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@
183183
<virtualType name="appDumpSystemSource" type="Magento\Config\App\Config\Source\DumpConfigSourceAggregated">
184184
<arguments>
185185
<argument name="sources" xsi:type="array">
186+
<item name="modular" xsi:type="array">
187+
<item name="source" xsi:type="object">Magento\Config\App\Config\Source\ModularConfigSource</item>
188+
<item name="sortOrder" xsi:type="string">10</item>
189+
</item>
186190
<item name="dynamic" xsi:type="array">
187191
<item name="source" xsi:type="object">Magento\Config\App\Config\Source\RuntimeConfigSource</item>
188192
<item name="sortOrder" xsi:type="string">100</item>

dev/tests/integration/testsuite/Magento/Deploy/Console/Command/App/ApplicationDumpCommandTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,23 @@ public function setUp()
7979
// Snapshot of configuration.
8080
$this->config = $this->loadConfig();
8181
$this->envConfig = $this->loadEnvConfig();
82+
83+
$this->writer->saveConfig(
84+
[
85+
ConfigFilePool::APP_CONFIG => [
86+
'system' => [
87+
'default' => [
88+
'web' => [
89+
'test' => [
90+
'test_value_3' => 'value from the file'
91+
]
92+
]
93+
]
94+
]
95+
]
96+
],
97+
true
98+
);
8299
}
83100

84101
/**
@@ -197,6 +214,13 @@ private function validateSystemSection(array $config)
197214
$this->assertArrayNotHasKey('test_sensitive_environment5', $config['system']['default']['web']['test']);
198215
$this->assertArrayNotHasKey('test_sensitive_environment6', $config['system']['default']['web']['test']);
199216
$this->assertArrayNotHasKey('test_environment9', $config['system']['default']['web']['test']);
217+
218+
$this->assertEquals('value from the file', $config['system']['default']['web']['test']['test_value_3']);
219+
$this->assertEquals('GB', $config['system']['default']['general']['country']['default']);
220+
$this->assertEquals(
221+
'HK,IE,MO,PA,GB',
222+
$config['system']['default']['general']['country']['optional_zip_countries']
223+
);
200224
}
201225

202226
/**

dev/tests/integration/testsuite/Magento/Deploy/_files/config_data.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
'' => [
99
'web/test/test_value_1' => 'http://local2.test/',
1010
'web/test/test_value_2' => 5,
11+
'web/test/test_value_3' => 'value from the DB',
1112
'web/test/test_sensitive' => 10,
13+
'general/country/default' => 'GB',
1214

1315
'web/test/test_sensitive1' => 'some_value1',
1416
'web/test/test_sensitive2' => 'some_value2',

0 commit comments

Comments
 (0)