Can not see test modules in module install page

by vijaycs85   Last Updated November 15, 2017 00:07 AM

In Drupal 7, tests module can be added with hidden = TRUE property in .info file to not to display on modules list page, but tests can find and enable them using protected $modules property.

But Drupal 8 doesn't have this property and the test modules don't appear in modules list page. How does it work?

Tags : 8


Answers 1


Test modules are under module_name/tests/ or module_name/tests/directory and can be enabled by TestDiscovery service. As ExtensionDiscovery::scan() calls TestDiscovery::getExtensions() method with $include_test flag TRUE.

The flag can be overridden by settings: if (!isset($include_tests)) { $include_tests = Settings::get('extension_discovery_scan_tests') || drupal_valid_test_ua(); }

See also ExtensionDiscovery::scanDirectory and RecursiveExtensionFilterIterator::acceptTests()

For manually enabling and testing a test module, it could be moved under modules directory (from /tests) and move back once development done to enable it via test.

vijaycs85
vijaycs85
November 14, 2017 23:32 PM

Related Questions