1111use Magento \Config \Console \Command \ConfigSet \ProcessorFacadeFactory ;
1212use Magento \Config \Console \Command \ConfigSetCommand ;
1313use Magento \Config \Console \Command \EmulatedAdminhtmlAreaProcessor ;
14+ use Magento \Config \Console \Command \LocaleEmulatorInterface ;
1415use Magento \Deploy \Model \DeploymentConfig \ChangeDetector ;
1516use Magento \Framework \App \DeploymentConfig ;
1617use Magento \Framework \Console \Cli ;
1718use Magento \Framework \Exception \ValidatorException ;
19+ use PHPUnit \Framework \MockObject \MockObject ;
1820use PHPUnit \Framework \MockObject \MockObject as Mock ;
1921use PHPUnit \Framework \TestCase ;
2022use Symfony \Component \Console \Tester \CommandTester ;
@@ -56,6 +58,11 @@ class ConfigSetCommandTest extends TestCase
5658 */
5759 private $ processorFacadeMock ;
5860
61+ /**
62+ * @var LocaleEmulatorInterface|MockObject
63+ */
64+ private $ localeEmulatorMock ;
65+
5966 /**
6067 * @inheritdoc
6168 */
@@ -76,12 +83,15 @@ protected function setUp(): void
7683 $ this ->deploymentConfigMock = $ this ->getMockBuilder (DeploymentConfig::class)
7784 ->disableOriginalConstructor ()
7885 ->getMock ();
86+ $ this ->localeEmulatorMock = $ this ->getMockBuilder (LocaleEmulatorInterface::class)
87+ ->getMockForAbstractClass ();
7988
8089 $ this ->command = new ConfigSetCommand (
8190 $ this ->emulatedAreProcessorMock ,
8291 $ this ->changeDetectorMock ,
8392 $ this ->processorFacadeFactoryMock ,
84- $ this ->deploymentConfigMock
93+ $ this ->deploymentConfigMock ,
94+ $ this ->localeEmulatorMock
8595 );
8696 }
8797
@@ -175,6 +185,12 @@ public function testExecuteWithException()
175185 ->method ('process ' )
176186 ->willThrowException (new ValidatorException (__ ('The "test/test/test" path does not exists ' )));
177187
188+ $ this ->localeEmulatorMock ->expects ($ this ->once ())
189+ ->method ('emulate ' )
190+ ->willReturnCallback (function ($ function ) {
191+ return $ function ();
192+ });
193+
178194 $ tester = new CommandTester ($ this ->command );
179195 $ tester ->execute ([
180196 ConfigSetCommand::ARG_PATH => 'test/test/test ' ,
0 commit comments