New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drush en incorrectly reports that it enabled new dependency modules #5057
base: 11.x
Are you sure you want to change the base?
drush en incorrectly reports that it enabled new dependency modules #5057
Conversation
Would be good to add a test for this, or add to an existing test |
can this be tested using test |
Yes, that is a good place to add testing for this. |
is this not already covered in drush/tests/functional/PmEnDisUnListInfoTest.php at line number 40
|
Not covered enough. If bug were already covered, the test would have been failing for years. |
I'm sorry @weitzman, I have not written any tests before, trying to write one first time here. adding code snippet I tried to write for this please let me know if this is good. wee need to add this at line number 47 in drush/tests/functional/PmEnDisUnListInfoTest.php. This will get all dependency for the already enabled module, then it will check if each dependent module is enabled or not using pm-list command.
We need to use below class as well to use addInstallDependencies() function. |
af029ea
to
ea8835b
Compare
Test added to verify that dependent module gets enabled. |
4a65201
to
88ccaf5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test seems not to cover the scenario thats added here
@@ -85,6 +85,12 @@ public function install(array $modules): void | |||
$this->output()->writeln(dt('The following module(s) will be enabled: !list', $todo_str)); | |||
return; | |||
} elseif (array_values($todo) !== $modules) { | |||
if(!in_array($modules, $todo_str)) { | |||
$this->output()->writeln(dt('Requested module is already enabled: !list', ['!list' => implode(', ', $modules)])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be. a logger msg of severity=notice
No description provided.