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.

Comments

Rok Žlender’s picture

StatusFileSize
new1.92 KB

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.

hadsie’s picture

Hey Rok,

After some testing your patch appears to be working just fine.

Rok Žlender’s picture

Status: Active » Needs review
StatusFileSize
new2.52 KB

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.

hadsie’s picture

After a few simple tests this seems to still be working ;)

Rok Žlender’s picture

Status: Needs review » Fixed

Committed to drupal 5 and HEAD thanks Scott for testing.

Anonymous’s picture

Status: Fixed » Closed (fixed)