Issue #3183739: Functional tests are installing all default farmOS modules
This is a temporary first step, but not a proper solution to the issue.
This commit is contained in:
parent
8419dc530e
commit
11c2f324e1
|
@ -55,6 +55,14 @@ function farm_install_modules(array &$install_state) {
|
|||
// the \Drupal\farm\Form\FarmModulesForm submit method.
|
||||
$modules = \Drupal::state()->get('farm.install_modules') ?: [];
|
||||
|
||||
// If this is running in the context of a functional test, do not install any
|
||||
// additional modules. This is a temporary hack.
|
||||
// @see Drupal\Tests\farm\Functional\FarmBrowserTestBase::setUp()
|
||||
// @todo https://www.drupal.org/project/farm/issues/3183739
|
||||
if (!empty($GLOBALS['farm_test'])) {
|
||||
$modules = [];
|
||||
}
|
||||
|
||||
// Load a list of all available modules, so that we can display their names.
|
||||
$module_handler = \Drupal::service('module_handler');
|
||||
|
||||
|
|
|
@ -13,4 +13,19 @@ class FarmBrowserTestBase extends BrowserTestBase {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
protected $profile = 'farm';
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp(): void {
|
||||
|
||||
// Set a global farm_test variable and then delegate to the parent setUp().
|
||||
// This is a temporary hack to prevent optional default farmOS modules from
|
||||
// being installed via the profile's hook_install_tasks().
|
||||
// @see farm_install_modules()
|
||||
// @todo https://www.drupal.org/project/farm/issues/3183739
|
||||
$GLOBALS['farm_test'] = TRUE;
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue