Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293477

Strengthen tests by not autoregistering non-test namespaces of disabled modules

$
0
0

During normal site operation, namespaces of disabled modules are not registered with the autoloader. This means if a module tries to instantiate a class provided by a disabled module, an error is (correctly) thrown.

However, during testing, simpletest.module registers the namespaces of all disabled modules in order to find their tests. This means that if a module has the error mentioned above, then it will not be discovered by the test.

In #1780396-54: Namespaces of disabled modules are registered during test runs, @Berdir suggested to fix this by limiting simpletest to only register the Tests subnamespace of each module. However, in that issue, @sun raised concerns about that making unit test writing too cumbersome (since in unit tests, there's no concept of enabling modules).


Viewing all articles
Browse latest Browse all 293477

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>