diff --git a/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php b/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
index c088eed..d5d92d9 100644
--- a/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
+++ b/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
@@ -134,6 +134,12 @@ public function __construct($root, $use_file_cache = TRUE, $profile_directories
    * - the site-wide directory; i.e., /
    * - the site-specific directory; e.g., /sites/example.com
    *
+   * To also find test modules, add
+   * @code
+   * $settings['extension_discovery_scan_tests'] = TRUE
+   * @encode
+   * to settings.php.
+   *
    * The information is returned in an associative array, keyed by the extension
    * name (without .info.yml extension). Extensions found later in the search
    * will take precedence over extensions found earlier - unless they are not
diff --git a/core/lib/Drupal/Core/Extension/ModuleInstallerInterface.php b/core/lib/Drupal/Core/Extension/ModuleInstallerInterface.php
index bd2923a..457fd5d 100644
--- a/core/lib/Drupal/Core/Extension/ModuleInstallerInterface.php
+++ b/core/lib/Drupal/Core/Extension/ModuleInstallerInterface.php
@@ -23,6 +23,12 @@
    *   - Invoke hook_install() and add it to the list of installed modules.
    * - Invoke hook_modules_installed().
    *
+   * To install test modules add
+   * @code
+   * $settings['extension_discovery_scan_tests'] = TRUE
+   * @encode
+   * to settings.php.
+   *
    * @param string[] $module_list
    *   An array of module names.
    * @param bool $enable_dependencies
diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php
index 6210396..53a1aeb 100644
--- a/core/modules/simpletest/src/KernelTestBase.php
+++ b/core/modules/simpletest/src/KernelTestBase.php
@@ -485,6 +485,12 @@ protected function installEntitySchema($entity_type_id) {
   /**
    * Enables modules for this test.
    *
+   * To enable test modules outside of the testing environment, add
+   * @code
+   * $settings['extension_discovery_scan_tests'] = TRUE
+   * @encode
+   * to settings.php.
+   *
    * @param array $modules
    *   A list of modules to enable. Dependencies are not resolved; i.e.,
    *   multiple modules have to be specified with dependent modules first.
diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php
index 1e3bfdb..b7c1d40 100644
--- a/core/modules/simpletest/src/WebTestBase.php
+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -1010,6 +1010,12 @@ protected function initKernel(Request $request) {
   /**
    * Install modules defined by `static::$modules`.
    *
+   * To enable test modules outside of the testing environment, add
+   * @code
+   * $settings['extension_discovery_scan_tests'] = TRUE
+   * @encode
+   * to settings.php.
+   *
    * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
    *   The container.
    */
diff --git a/core/tests/Drupal/KernelTests/KernelTestBase.php b/core/tests/Drupal/KernelTests/KernelTestBase.php
index 0c2db9a..399ef0c 100644
--- a/core/tests/Drupal/KernelTests/KernelTestBase.php
+++ b/core/tests/Drupal/KernelTests/KernelTestBase.php
@@ -786,6 +786,12 @@ protected function installEntitySchema($entity_type_id) {
   /**
    * Enables modules for this test.
    *
+   * To enable test modules outside of the testing environment, add
+   * @code
+   * $settings['extension_discovery_scan_tests'] = TRUE
+   * @encode
+   * to settings.php.
+   *
    * @param string[] $modules
    *   A list of modules to enable. Dependencies are not resolved; i.e.,
    *   multiple modules have to be specified individually. The modules are only
diff --git a/sites/example.settings.local.php b/sites/example.settings.local.php
index dfcc244..65d442d 100644
--- a/sites/example.settings.local.php
+++ b/sites/example.settings.local.php
@@ -79,8 +79,8 @@
  * Allow test modules and themes to be installed.
  *
  * Drupal ignores test modules and themes by default for performance reasons.
- * During development it can be useful to install test extensions for debugging
- * purposes.
+ * During development it can be useful to install hidden test extensions for
+ * debugging purposes.
  */
 $settings['extension_discovery_scan_tests'] = TRUE;
 
