I have folders structure:

sites
- my_site
- modules
- custom
- my_module
- tests\src\Kernel\MyTest.php

With code part:

  static protected $modules = [
    'my_module',
  ];

When I start test I have:

Unavailable module: 'my_module'. If this module needs to be downloaded separately, annotate the test class with '@requires module my_module'.

And If I add:

  protected function setUpFilesystem() {
    parent::setUpFilesystem();
    $this->setSetting('test_parent_site', 'sites/my_site');
  }

error is gone.

But this is just a workaround.

I guess this error appears only in kernel tests, because for functional test in FunctionalTestSetupTrait.php there is:

    $settings['settings']['test_parent_site'] = (object) [
      'value' => $this->originalSite,
      'required' => TRUE,
    ];

I guess such test_parent_site setting definition should be for kernel test too.

Comments

super_romeo created an issue. See original summary.

quietone’s picture

Component: simpletest.module » phpunit

Simpletest module is no longer in core, moving to testing component.

longwave’s picture

cilefen’s picture

Status: Active » Closed (duplicate)
Issue tags: +Bug Smash Initiative

It seems so.

super_romeo’s picture

I confirm.