API page: https://api.drupal.org/api/drupal/core%21tests%21Drupal%21KernelTests%21...

> string|string[] $modules: A list of modules for which to install default configuration.

It appears that a single module is also allowed for this param -- docs should say that.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim created an issue. See original summary.

tobiberlin’s picture

Status: Active » Needs review
FileSize
882 bytes

Attached find a patch. Hopefully it is what you intended?

dawehner’s picture

+++ b/core/tests/Drupal/KernelTests/KernelTestBase.php
@@ -766,8 +766,9 @@ protected function installEntitySchema($entity_type_id) {
-   * @param string[] $modules
-   *   A list of modules to enable. Dependencies are not resolved; i.e.,
+   * @param string|array $modules

Note:

string[]

is totally valid. It indicates an array of strings. So what about using string|string[]?

joachim’s picture

Status: Needs review » Needs work
shashikant_chauhan’s picture

Status: Needs work » Needs review
FileSize
671 bytes

Adding patch installConfig doc.

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

The docs now match the functionality. This method also appears in the deprecated \Drupal\simpletest\KernelTestBase but I don't think we should spend effort maintaining docs on deprecated code.

alexpott’s picture

Title: clarify param in KernelTestBase::installConfig() » Clarify param in KernelTestBase::installConfig()

Fixing the issue title.

larowlan’s picture

adding reviewers that shaped the patch

  • larowlan committed 428362c on 8.5.x
    Issue #2912666 by shashikant_chauhan, tobiberlin, dawehner: Clarify...

  • larowlan committed f38b718 on 8.4.x
    Issue #2912666 by shashikant_chauhan, tobiberlin, dawehner: Clarify...
larowlan’s picture

Version: 8.5.x-dev » 8.4.x-dev
Status: Reviewed & tested by the community » Fixed

Committed as 428362c and pushed to 8.5.x.
Cherry-picked as f38b718 and pushed to 8.4.x.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.