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

Rok Žlender - July 7, 2007 - 09:33

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.

AttachmentSize
drupal_unit_testsmodulerefresh.patch1.92 KB

#2

hadsie - July 19, 2007 - 18:18

Hey Rok,

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

#3

Rok Žlender - July 21, 2007 - 08:48
Status:active» patch (code needs review)

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.

AttachmentSize
simpeltest_modulelist.patch2.52 KB

#4

hadsie - July 22, 2007 - 20:10

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

#5

Rok Žlender - July 23, 2007 - 12:14
Status:patch (code needs review)» fixed

Committed to drupal 5 and HEAD thanks Scott for testing.

#6

Anonymous - August 6, 2007 - 12:25
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.