Skip to content

Commit 807a06d

Browse files
author
Oleksandr Gorkun
committed
MAGETWO-99413: Update symfony/console dependency
1 parent 1eb6722 commit 807a06d

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

setup/src/Magento/Setup/Console/Command/ConfigSetCommand.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
use Magento\Framework\Config\ConfigOptionsListConstants;
1111
use Magento\Framework\Module\ModuleList;
1212
use Magento\Setup\Model\ConfigModel;
13+
use Symfony\Component\Console\Helper\QuestionHelper;
1314
use Symfony\Component\Console\Input\InputInterface;
1415
use Symfony\Component\Console\Output\OutputInterface;
16+
use Symfony\Component\Console\Question\ConfirmationQuestion;
1517

1618
class ConfigSetCommand extends AbstractSetupCommand
1719
{
@@ -81,10 +83,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
8183

8284
$currentValue = $this->deploymentConfig->get($option->getConfigPath());
8385
if (($currentValue !== null) && ($inputOptions[$option->getName()] !== null)) {
84-
$dialog = $this->getHelperSet()->get('dialog');
85-
if (!$dialog->askConfirmation(
86+
/** @var QuestionHelper $question */
87+
$question = $this->getHelper('question');
88+
if (!$question->ask(
89+
$input,
8690
$output,
87-
'<question>Overwrite the existing configuration for ' . $option->getName() . '?[Y/n]</question>'
91+
new ConfirmationQuestion(
92+
'<question>Overwrite the existing configuration for '
93+
. $option->getName() . '?[Y/n]</question>'
94+
)
8895
)) {
8996
$inputOptions[$option->getName()] = null;
9097
}

setup/src/Magento/Setup/Test/Unit/Console/Command/ConfigSetCommandTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,18 @@ public function testExecuteInteractiveWithNo()
9696
*/
9797
private function checkInteraction($interactionType)
9898
{
99-
$dialog = $this->createMock(\Symfony\Component\Console\Helper\DialogHelper::class);
99+
$dialog = $this->createMock(\Symfony\Component\Console\Helper\QuestionHelper::class);
100100
$dialog
101101
->expects($this->once())
102-
->method('askConfirmation')
102+
->method('ask')
103103
->will($this->returnValue($interactionType));
104104

105105
/** @var \Symfony\Component\Console\Helper\HelperSet|\PHPUnit_Framework_MockObject_MockObject $helperSet */
106106
$helperSet = $this->createMock(\Symfony\Component\Console\Helper\HelperSet::class);
107107
$helperSet
108108
->expects($this->once())
109109
->method('get')
110-
->with('dialog')
110+
->with('question')
111111
->will($this->returnValue($dialog));
112112
$this->command->setHelperSet($helperSet);
113113

0 commit comments

Comments
 (0)