Skip to content

Commit

Permalink
added test for dependent module enablement
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeshreeputra committed Oct 21, 2022
1 parent f7c8537 commit 88ccaf5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tests/functional/PmInUnListInfoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace Unish;

use Composer\Semver\Comparator;

use Drush\Drupal\Commands\pm\PmCommands;
/**
* @group slow
* @group pm
Expand Down Expand Up @@ -46,6 +46,17 @@ public function testEnDisUnList()
$this->drush('core:status', [], ['field' => 'drupal-version']);
$drupal_version = $this->getOutputRaw();

// Test pm-enable enables a dependent module for already enabled module,
// and pm-list verifies that.
$list_of_dependent_modules = PmCommands::addInstallDependencies('drush_empty_module');
$dependent_modules = ['!list' => implode(', ', $list_of_dependent_modules)];
foreach($dependent_modules as $dependent_module){
$this->drush('pm-enable', [$dependent_module]);
$this->drush('pm-list', [], ['status' => 'enabled']);
$out = $this->getOutput();
$this->assertStringContainsString($module_dependency, $out);
}

// Test the testing install profile theme is installed.
$active_theme = 'stark';
$this->assertStringContainsString($active_theme, $out, 'Themes are in the pm-list');
Expand Down

0 comments on commit 88ccaf5

Please sign in to comment.