Skip to content

Commit 0e9dfd0

Browse files
author
Yevhen Miroshnychenko
committed
MAGETWO-66771: CLI command config:sensitive:set doesn't encrypt input values
1 parent 57c7353 commit 0e9dfd0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

app/code/Magento/Config/Console/Command/EmulatedAdminhtmlAreaProcessor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ public function __construct(ScopeInterface $scope, State $state)
4646
*
4747
* @param callable $callback The callable to be called
4848
* @param array $params The parameters to be passed to the callback, as an indexed array
49-
* @return boolean|integer|float|string|array|object|callable|resource|null
49+
* @return bool|int|float|string|array|null - as the result of this method is the result of callback,
50+
* you can use callback only with specified in this method return types
5051
* @throws \Exception The exception is thrown if the parameter $callback throws an exception
5152
*/
5253
public function process(callable $callback, array $params = [])

app/code/Magento/Config/Test/Unit/Console/Command/EmulatedAdminhtmlAreaProcessorTest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Config\Test\Unit\Console\Command;
77

88
use Magento\Config\Console\Command\EmulatedAdminhtmlAreaProcessor;
9+
use Magento\Framework\App\Area;
910
use Magento\Framework\App\State;
1011
use Magento\Framework\Config\ScopeInterface;
1112
use PHPUnit_Framework_MockObject_MockObject as MockObject;
@@ -51,6 +52,8 @@ protected function setUp()
5152
public function testProcess()
5253
{
5354
$currentScope = 'currentScope';
55+
$callback = function () {
56+
};
5457
$this->scopeMock->expects($this->once())
5558
->method('getCurrentScope')
5659
->willReturn($currentScope);
@@ -60,10 +63,11 @@ public function testProcess()
6063
->with($currentScope);
6164

6265
$this->stateMock->expects($this->once())
63-
->method('emulateAreaCode');
66+
->method('emulateAreaCode')
67+
->with(Area::AREA_ADMINHTML, $callback)
68+
->willReturn('result');
6469

65-
$this->emulatedAdminhtmlProcessorArea->process(function () {
66-
});
70+
$this->assertEquals('result', $this->emulatedAdminhtmlProcessorArea->process($callback));
6771
}
6872

6973
/**

0 commit comments

Comments
 (0)