Skip to content

Commit d510642

Browse files
nmalevanechostep
authored andcommitted
Fix static tests.
1 parent 69a1b98 commit d510642

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

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

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,12 @@ public function __construct(
5656
*/
5757
protected function configure()
5858
{
59-
$this->setName('module:config:status')
60-
->setDescription('Checks the modules configuration in the \'app/etc/config.php\' file and reports if they are up to date or not');
59+
$this
60+
->setName('module:config:status')
61+
->setDescription(
62+
'Checks the modules configuration in the \'app/etc/config.php\' file '
63+
. 'and reports if they are up to date or not'
64+
);
6165

6266
parent::configure();
6367
}
@@ -71,6 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7175
// the config as currently in app/etc/config.php
7276
$currentConfig = $this->configReader->load(ConfigFilePool::APP_CONFIG);
7377
if (!array_key_exists(ConfigOptionsListConstants::KEY_MODULES, $currentConfig)) {
78+
// phpcs:ignore Magento2.Exceptions.DirectThrow
7479
throw new \Exception('Can\'t find the modules configuration in the \'app/etc/config.php\' file.');
7580
}
7681

@@ -82,14 +87,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
8287
$correctModuleConfig = $installer->getModulesConfig();
8388

8489
if ($currentModuleConfig !== $correctModuleConfig) {
90+
// phpcs:ignore Magento2.Exceptions.DirectThrow
8591
throw new \Exception(
86-
'The modules configuration in the \'app/etc/config.php\' file is outdated. Run \'setup:upgrade\' to fix it.'
92+
'The modules configuration in the \'app/etc/config.php\' file is outdated. '
93+
. 'Run \'setup:upgrade\' to fix it.'
8794
);
8895
}
8996

9097
$output->writeln(
9198
'<info>The modules configuration is up to date.</info>'
9299
);
100+
// phpcs:disable Magento2.Exceptions.ThrowCatch
93101
} catch (\Exception $e) {
94102
$output->writeln('<error>' . $e->getMessage() . '</error>');
95103

setup/src/Magento/Setup/Console/CommandList.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ public function getCommands()
9292
if (class_exists($class)) {
9393
$commands[] = $this->serviceManager->get($class);
9494
} else {
95+
// phpcs:ignore Magento2.Exceptions.DirectThrow
9596
throw new \Exception('Class ' . $class . ' does not exist');
9697
}
9798
}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
use PHPUnit\Framework\TestCase;
1414
use Symfony\Component\Console\Tester\CommandTester;
1515

16+
/**
17+
* Tests for module config status command.
18+
*/
1619
class ModuleConfigStatusCommandTest extends TestCase
1720
{
1821
/**
@@ -49,7 +52,8 @@ public function testExecute(array $currentConfig, array $correctConfig, string $
4952
public function executeDataProvider()
5053
{
5154
$successMessage = 'The modules configuration is up to date.' . PHP_EOL;
52-
$failureMessage = 'The modules configuration in the \'app/etc/config.php\' file is outdated. Run \'setup:upgrade\' to fix it.' . PHP_EOL;
55+
$failureMessage = 'The modules configuration in the \'app/etc/config.php\' '
56+
. 'file is outdated. Run \'setup:upgrade\' to fix it.' . PHP_EOL;
5357

5458
return [
5559
[

0 commit comments

Comments
 (0)