Skip to content

Commit 638a149

Browse files
committed
MAGETWO-98409: Config:set command failed for path bigger than 3 depth
1 parent 7a7ecde commit 638a149

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
@@ -7,6 +7,8 @@
77
namespace Magento\Config\Console\Command;
88

99
use Magento\Config\Model\Config\Backend\Admin\Custom;
10+
use Magento\Config\Model\Config\Structure\Converter;
11+
use Magento\Config\Model\Config\Structure\Data as StructureData;
1012
use Magento\Directory\Model\Currency;
1113
use Magento\Framework\App\Config\ConfigPathResolver;
1214
use Magento\Framework\App\Config\ScopeConfigInterface;
@@ -91,6 +93,8 @@ protected function setUp()
9193
{
9294
Bootstrap::getInstance()->reinitialize();
9395
$this->objectManager = Bootstrap::getObjectManager();
96+
$this->extendSystemStructure();
97+
9498
$this->scopeConfig = $this->objectManager->get(ScopeConfigInterface::class);
9599
$this->reader = $this->objectManager->get(FileReader::class);
96100
$this->filesystem = $this->objectManager->get(Filesystem::class);
@@ -123,6 +127,21 @@ protected function tearDown()
123127
$this->appConfig->reinit();
124128
}
125129

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

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)