Skip to content

Commit 3d9df7a

Browse files
committed
Merge pull request #152 from jmolivas/module-generator-test-fix
Show test question only if controller will be generated
2 parents c764b35 + 16c5668 commit 3d9df7a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Tests/Command/GeneratorModuleCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function getInteractiveData()
3939
// case one basic options
4040
[
4141
[],
42-
['foo', 'foo', $dir, 'My Awesome Module', '8.x', 'Other', false, true, true],
42+
['foo', 'foo', $dir, 'My Awesome Module', '8.x', 'Other', false, false, true],
4343
"foo\nfoo\n$dir\n"
4444
],
4545
];

src/Command/GeneratorModuleCommand.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,14 @@ function ($machine_name) {
142142
}
143143
$input->setOption('controller', $controller);
144144

145-
$tests = $input->getOption('tests');
146-
if (!$tests && $dialog->askConfirmation($output, $dialog->getQuestion('Do you want to generate Test', 'yes', '?'), TRUE)) {
147-
$tests = TRUE;
145+
if ($controller){
146+
$tests = $input->getOption('tests');
147+
if (!$tests && $dialog->askConfirmation($output, $dialog->getQuestion('Do you want to generate Test', 'yes', '?'), true)) {
148+
$tests = true;
149+
}
150+
}
151+
else {
152+
$tests = false;
148153
}
149154
$input->setOption('tests', $tests);
150155

0 commit comments

Comments
 (0)