Skip to content

Commit 0f1e9db

Browse files
author
Yevhen Miroshnychenko
committed
MAGETWO-64556: Configuration management - Hide sensitive values from config:show command
1 parent 7c4212b commit 0f1e9db

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

app/code/Magento/Config/Console/Command/ConfigShow/ValueProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ public function process($scope, $scopeCode, $value, $path)
9696
? self::SAFE_PLACEHOLDER
9797
: $backendModel->getValue();
9898
}
99-
}
99+
}

app/code/Magento/Config/Test/Unit/Console/Command/ConfigShow/ValueProcessorTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
use Magento\Config\Console\Command\ConfigShow\ValueProcessor;
1616
use Magento\Config\Model\Config\Backend\Encrypted;
1717

18-
18+
/**
19+
* Test for ValueProcessor.
20+
*
21+
* @see ValueProcessor
22+
*/
1923
class ValueProcessorTest extends \PHPUnit_Framework_TestCase
2024
{
2125
/**

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@
2222
use Magento\Framework\Config\File\ConfigFilePool;
2323
use Magento\Framework\Config\ScopeInterface as ConfigScopeInterface;
2424
use Magento\Framework\Config\FileIteratorFactory;
25+
use \Magento\Framework\App\AreaList;
26+
use \Magento\Backend\App\Area\FrontNameResolver;
2527

28+
/**
29+
* Test for ConfigShowCommand.
30+
*
31+
* @see ConfigShowCommand
32+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
33+
*/
2634
class ConfigShowCommandTest extends \PHPUnit_Framework_TestCase
2735
{
2836
/**
@@ -67,10 +75,14 @@ class ConfigShowCommandTest extends \PHPUnit_Framework_TestCase
6775

6876
public function setUp()
6977
{
78+
Bootstrap::getInstance()->reinitialize();
79+
7080
$this->objectManager = Bootstrap::getObjectManager();
7181

7282
$this->objectManager->get(ConfigScopeInterface::class)->setCurrentScope(Area::AREA_ADMINHTML);
7383

84+
$this->objectManager->get(AreaList::class)->getArea(FrontNameResolver::AREA_CODE)->load(Area::PART_CONFIG);
85+
7486
$fileIteratorFactory = $this->objectManager->get(FileIteratorFactory::class);
7587
$fileIterator = $fileIteratorFactory->create([__DIR__ . '/../../_files/system.xml']);
7688

0 commit comments

Comments
 (0)