Reset module_list() and module_implements() on test setup.
Darren Oh - April 21, 2009 - 20:12
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | simpletest.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | duplicate |
Description
I don't know if this causes problems in Drupal 7, but with simpletest on Drupal 6, if module_exists() is called during set-up, the result is wrong because the static variable is not refreshed until after the modules are installed.
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| drupal_web_test_case.php_.patch | 855 bytes | Idle | Failed: Failed to apply patch. | View details | Re-test |

#1
Patch for Drupal 6 at http://drupal.org/node/440836.
#2
Seems to be in order for now, but be aware that module.inc is going to be converted to the static caching API, and these calls may then have to be replaced with
drupal_static_reset('module_list')etc. Depending on whether the $reset parameter is removed from these, which is still debated.The issue to follow is #422370: convert mail.inc, module.inc, and pager.inc to use new static caching API.
#3
The last submitted patch failed testing.
#4
This patch fixes the errors a lot of us are seeing in D6 and D7 with exceptions with tables not found (cache_update, etc).
#5
Re-roll.
#6
Try out: #472684: Install non-default modules one at a time to ensure proper module list is maintained during installation hooks I think it is the parent bug.
#7
The root problem is that the module list from the previous test is being used during the setup the next test. This patch actually fixes the problem, rather than working around it.
P.S. I now see that the other issue fixes the install system rather than the testing system, so it's not a workaround. My main concern was to make the testing system work the same way as enabling modules on the module administration page. That patch would do that.
#8
Since the other patch appears to have a good chance of being committed, I'm setting the status of this issue to duplicate.
#9
This patch does not fix both problems, but the other patch does so lets stick with that one.