Skip to content

Commit aca3738

Browse files
committed
MAGETWO-98527: Config:set command failed for path bigger than 3 depth
1 parent a0f5f96 commit aca3738

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

dev/tests/integration/testsuite/Magento/Config/Console/Command/ConfigSetCommandTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
namespace Magento\Config\Console\Command;
77

88
use Magento\Config\Model\Config\Backend\Admin\Custom;
9+
use Magento\Config\Model\Config\Structure\Converter;
10+
use Magento\Config\Model\Config\Structure\Data as StructureData;
911
use Magento\Directory\Model\Currency;
1012
use Magento\Framework\App\Config\ConfigPathResolver;
1113
use Magento\Framework\App\Config\ScopeConfigInterface;
@@ -90,6 +92,8 @@ protected function setUp()
9092
{
9193
Bootstrap::getInstance()->reinitialize();
9294
$this->objectManager = Bootstrap::getObjectManager();
95+
$this->extendSystemStructure();
96+
9397
$this->scopeConfig = $this->objectManager->get(ScopeConfigInterface::class);
9498
$this->reader = $this->objectManager->get(FileReader::class);
9599
$this->filesystem = $this->objectManager->get(Filesystem::class);
@@ -122,6 +126,21 @@ protected function tearDown()
122126
$this->appConfig->reinit();
123127
}
124128

129+
/**
130+
* Add test system structure to main system structure
131+
*
132+
* @return void
133+
*/
134+
private function extendSystemStructure()
135+
{
136+
$document = new \DOMDocument();
137+
$document->load(__DIR__ . '/../../_files/system.xml');
138+
$converter = $this->objectManager->get(Converter::class);
139+
$systemConfig = $converter->convert($document);
140+
$structureData = $this->objectManager->get(StructureData::class);
141+
$structureData->merge($systemConfig);
142+
}
143+
125144
/**
126145
* @return array
127146
*/
@@ -190,6 +209,8 @@ public function runLockDataProvider()
190209
['general/region/display_all', '1'],
191210
['general/region/state_required', 'BR,FR', ScopeInterface::SCOPE_WEBSITE, 'base'],
192211
['admin/security/use_form_key', '0'],
212+
['general/group/subgroup/field', 'default_value'],
213+
['general/group/subgroup/field', 'website_value', ScopeInterface::SCOPE_WEBSITE, 'base'],
193214
];
194215
}
195216

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
9+
<system>
10+
<section id="general">
11+
<group id="group">
12+
<group id="subgroup">
13+
<field id="field" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
14+
<label>Label</label>
15+
</field>
16+
</group>
17+
</group>
18+
</section>
19+
</system>
20+
</config>

0 commit comments

Comments
 (0)