Skip to content

Commit a9273b9

Browse files
committed
MAGETWO-69854: Can't set allowed or default currencies using config:set command
1 parent 40df0ce commit a9273b9

File tree

2 files changed

+1
-80
lines changed

2 files changed

+1
-80
lines changed

app/code/Magento/Config/Model/PreparedValueFactory.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Magento\Framework\App\Config\Value;
1414
use Magento\Framework\App\ScopeInterface;
1515
use Magento\Store\Model\ScopeTypeNormalizer;
16-
use Magento\Store\Model\ScopeInterface as StoreScopeInterface;
1716
use Magento\Framework\App\ScopeResolverPool;
1817
use Magento\Framework\Exception\RuntimeException;
1918

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

Lines changed: 1 addition & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ public function configSetValidationErrorDataProvider()
315315
[
316316
Custom::XML_PATH_UNSECURE_BASE_URL,
317317
'value',
318-
'Invalid value. Value must be a URL or one of placeholders: {{base_url}}'
318+
'Invalid Base URL. Value must be a URL or one of placeholders: {{base_url}}'
319319
],
320320
//set not existed field path
321321
[
@@ -504,82 +504,4 @@ private function setConfig($path, $value, $message, $scope, $scopeCode)
504504
$status = $command->run($input, $output);
505505
return $status;
506506
}
507-
508-
/**
509-
* Tests different scenarios for scope options.
510-
*
511-
* @param \Closure $expectations
512-
* @param string $path
513-
* @param string $value
514-
* @param string $scope
515-
* @param string $scopeCode
516-
* @magentoDbIsolation enabled
517-
* @dataProvider getRunPathValidationDataProvider
518-
*/
519-
public function testRunPathValidation(
520-
\Closure $expectations,
521-
$path,
522-
$value,
523-
$scope = ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
524-
$scopeCode = null
525-
) {
526-
$this->inputMock->expects($this->any())
527-
->method('getArgument')
528-
->willReturnMap([
529-
[ConfigSetCommand::ARG_PATH, $path],
530-
[ConfigSetCommand::ARG_VALUE, $value]
531-
]);
532-
$this->inputMock->expects($this->any())
533-
->method('getOption')
534-
->willReturnMap([
535-
[ConfigSetCommand::OPTION_SCOPE, $scope],
536-
[ConfigSetCommand::OPTION_SCOPE_CODE, $scopeCode]
537-
]);
538-
539-
$expectations($this->outputMock);
540-
541-
/** @var ConfigSetCommand $command */
542-
$command = $this->objectManager->create(ConfigSetCommand::class);
543-
$command->run($this->inputMock, $this->outputMock);
544-
}
545-
546-
/**
547-
* Retrieves variations with callback, path, value, scope and scope code.
548-
*
549-
* @return array
550-
*/
551-
public function getRunPathValidationDataProvider()
552-
{
553-
return [
554-
[
555-
function (Mock $output) {
556-
$output->expects($this->once())
557-
->method('writeln')
558-
->with('<info>Value was saved.</info>');
559-
},
560-
'web/unsecure/base_url',
561-
'http://magento2.local/',
562-
],
563-
[
564-
function (Mock $output) {
565-
$output->expects($this->once())
566-
->method('writeln')
567-
->with(
568-
'<error>Invalid Base URL. Value must be a URL or one of placeholders: {{base_url}}</error>'
569-
);
570-
},
571-
'web/unsecure/base_url',
572-
'value',
573-
],
574-
[
575-
function (Mock $output) {
576-
$output->expects($this->once())
577-
->method('writeln')
578-
->with('<error>The "test/test/test" path does not exist</error>');
579-
},
580-
'test/test/test',
581-
'value',
582-
]
583-
];
584-
}
585507
}

0 commit comments

Comments
 (0)