Skip to content

Commit 0a0f06c

Browse files
author
Vitaliy
authored
Merge pull request #268 from coderimus/262-fix-command-namespace
262: Change the CLI command namespace
2 parents 4eb16d5 + 1e9032e commit 0a0f06c

File tree

7 files changed

+13
-9
lines changed

7 files changed

+13
-9
lines changed

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ apply plugin: 'org.jetbrains.intellij'
2020
apply plugin: 'java'
2121
apply plugin: 'groovy'
2222

23+
gradle.startParameter.showStacktrace = org.gradle.api.logging.configuration.ShowStacktrace.ALWAYS_FULL
24+
2325
def phpPluginVersion = System.getProperty("phpPluginVersion", "201.7223.91")
2426
def ideaVersion = System.getProperty("ideaVersion", "2020.1.1")
2527
def javaVersion = 1.8

resources/magento2/common.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ common.cli.create.new.cli.command.title=Create a new Magento 2 CLI Command
4444
common.cli.generate.error=New CLI Command Generation Error
4545
common.cli.class.title=CLI Command Class
4646
common.validationErrorTitle=Validation Error
47-
common.defaultConsoleDirectory=Console
47+
common.defaultConsoleDirectory=Console/Command
4848
common.cronGroup.description.scheduleGenerateEvery=Frequency (in minutes) that schedules are written to the cron_schedule table.
4949
common.cronGroup.description.scheduleAheadFor=Time (in minutes) in advance that schedules are written to the cron_schedule table.
5050
common.cronGroup.description.scheduleLifetime=Window of time (in minutes) that cron job must start or will be considered missed ("too late" to run).

testData/actions/generation/generator/CLICommandClassGenerator/generateCLICommandClass/TestCLICommandPHPClass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Foo\Bar\Console;
3+
namespace Foo\Bar\Console\Command;
44

55
use Symfony\Component\Console\Command\Command;
66
use Symfony\Component\Console\Input\InputInterface;

testData/actions/generation/generator/CLICommandDiXmlGenerator/addingTwoCLICommandToDiXml/di.xml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
<type name="Magento\Framework\Console\CommandListInterface">
55
<arguments>
66
<argument name="commands" xsi:type="array">
7-
<item name="foo_bar_test_command" xsi:type="object">Foo\Bar\Console\TestCommand</item>
8-
<item name="foo_bar_one_more_c_l_i_command" xsi:type="object">Foo\Bar\Console\OneMoreCLICommand</item>
7+
<item name="foo_bar_test_command" xsi:type="object">Foo\Bar\Console\Command\TestCommand</item>
8+
<item name="foo_bar_one_more_c_l_i_command" xsi:type="object">
9+
Foo\Bar\Console\Command\OneMoreCLICommand
10+
</item>
911
</argument>
1012
</arguments>
1113
</type>

testData/actions/generation/generator/CLICommandDiXmlGenerator/initializeCLICommand/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<type name="Magento\Framework\Console\CommandListInterface">
55
<arguments>
66
<argument name="commands" xsi:type="array">
7-
<item name="foo_bar_test_command" xsi:type="object">Foo\Bar\Console\TestCommand</item>
7+
<item name="foo_bar_test_command" xsi:type="object">Foo\Bar\Console\Command\TestCommand</item>
88
</argument>
99
</arguments>
1010
</type>

tests/com/magento/idea/magento2plugin/actions/generation/generator/CLICommandClassGeneratorTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212
public class CLICommandClassGeneratorTest extends BaseGeneratorTestCase {
1313
private static final String CLASS_NAME = "TestCLICommandPHPClass";
14-
private static final String PARENT_DIRECTORY = "Console";
14+
private static final String PARENT_DIRECTORY = "Console/Command";
1515
private static final String COMMAND_NAME = "bar:test-command";
1616
private static final String DESCRIPTION = "This is the test command";
17-
private static final String NAMESPACE = "Foo\\Bar\\Console";
17+
private static final String NAMESPACE = "Foo\\Bar\\Console\\Command";
1818
private static final String MODULE_NAME = "Foo_Bar";
1919

2020
/**
@@ -38,7 +38,7 @@ public void testGenerateCLICommandClass() {
3838

3939
assertGeneratedFileIsCorrect(
4040
expectedFile,
41-
"src/app/code/Foo/Bar/Console",
41+
"src/app/code/Foo/Bar/Console/Command",
4242
cliCommandClass
4343
);
4444
}

tests/com/magento/idea/magento2plugin/actions/generation/generator/CLICommandDiXmlGeneratorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class CLICommandDiXmlGeneratorTest extends BaseGeneratorTestCase {
2222
private static final String CLASS_NAME = "TestCommand";
2323
private static final String SECOND_CLASS_NAME = "OneMoreCLICommand";
2424
private static final String MODULE_NAME = "Foo_Bar";
25-
private static final String PARENT_DIR = "Console";
25+
private static final String PARENT_DIR = "Console\\Command";
2626
private static final String MODULE_DIR = "src/app/code/Foo/Bar/";
2727

2828
/**

0 commit comments

Comments
 (0)