Once tests are done running and HTML for the results is generated, the execution of the admin/build/simpletest page (for instance, rendering of the blocks) continues with the static values produced by the tests. module_list(), module_implements(), drupal_get_schema(), for instance, are broken.
Example : when running a site with Views enabled and a 'page' view if defined, after running some tests you get the following (abridged) call sequence :
user_block()
menu_tree('navigation')
_menu_check_access($item = menu item for the 'page' views, with 'access_callback' = 'views_access')
views_access()
views_db_object::init()
drupal_get_schema('views_view') - views was not enabled during the tests, so this returns FALSE, which of course views's code doesn't expect and you get nasty PHP error messages.
Attached patch resets a few important static variables in tearDown()
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | drupal_web_test_case_statics.patch | 872 bytes | yched |
| #2 | drupal_web_test_case_statics.patch | 866 bytes | yched |
| drupal_web_test_case_statics.patch | 1.28 KB | yched |
Comments
Comment #1
yched commentedComment #2
yched commentedOops, previous patch merged in pwolanin's http://drupal.org/node/274486
Comment #3
yched commentedFixed the call language_list().
Comment #4
boombatower commentedLets see if we backport 7.x batch API version which eliminates static issues all together.
Comment #5
boombatower commentedbackported.
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.