Download & Extend

hook_modules_installed() not invoked during tests

Project:Drupal core
Version:7.x-dev
Component:simpletest.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

While working on the RDF patches, stefan-agaric and I realized that during the tests, hook_modules_installed() is not invoked the same way it is invoked during a normal installation. This is due to the following line in drupal_web_test_case.php:

    drupal_install_modules($profile_details['dependencies'], TRUE);

where the second parameter disabled the invokation of hook_modules_installed(). This is unfortunate as we rely on rdf_modules_installed() to setup the RDF mappings of the newly installed modules. A manual installation of core works perfectly, while the tests fail.

This was introduced in drupal_web_test_case.php rev 1.82 with the monster patch #361683: Field API initial patch
but I could not find any explanation on why this was changed. Why do we want simpletest to behave differently than a manual installation workflow?

To work around this we have to manually invoke hook_modules_installed() in our tests , which feels like a hack.

related issues:
#569326: Add hook_taxonomy_vocabulary_info() (#5)
#347959: modules_installed is broken during testing

Comments

#1

Status:active» closed (duplicate)

Marking as duplicate of #347959: modules_installed is broken during testing

nobody click here