module_list is being called incorrectly in drupal_unit_tests
hadsie - June 20, 2007 - 23:56
| Project: | SimpleTest |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
I think, but am not sure, that the module_list method is being called incorrectly in drupal_unit_tests.php. It's being called:
module_list(TRUE)
But I think it should be:
module_list(TRUE, FALSE)
bootstrap is the second parameter (which is TRUE by default). This resets the module list to just a minimal list of modules. This is causing some problems when trying to interface with the code. drupal_test_case.php also calls module_list, but calls it setting the bootstrap parameter to FALSE.

#1
I looked into it. drupalModuleEnable function in drupal_unit_tests is rarely used thats why it hasnt been updated. Attached patch fixes modleEnable function and it is now equal to moduleEnable function in drupal_test_case.
If you can test it and let me know if it fixes your problems.
#2
Hey Rok,
After some testing your patch appears to be working just fine.
#3
After a bit of research I noticed that module_list is not necessary when you call module_enable because thats already done. So now I removed call to module_list where we enable modules with module_enable.
#4
After a few simple tests this seems to still be working ;)
#5
Committed to drupal 5 and HEAD thanks Scott for testing.
#6