Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Right now there are no test to see if #attached_css and #attached_js actually work (and as you will see #attached_js will fail a test).
Comment | File | Size | Author |
---|---|---|---|
#6 | attached-css-js-522782.patch | 1.81 KB | AaronBauman |
attached-css-js-tests.patch | 2.42 KB | tic2000 | |
Comments
Comment #2
tic2000 CreditAttribution: tic2000 commentedThis will always have one fail because of #510108: Call theme closure function in process_page, not preprocess_page. We need that or #469242: Move <head> outside page.tpl.php commited to pass the test.
If I set it to CNR the bot will not be happy. If I let it CNW it will be ignored. I'll set to RTBC to have some eyes reviewing this.
PS. Any method to stop the bot from testing the patch?
Comment #3
Damien Tournoud CreditAttribution: Damien Tournoud commentedComment #6
AaronBaumanRerolled against re-worked #attached_library/css/js framework
This patch implements tests for attaching css and javascript via
drupal_render
's #attached property, similar toJavaScriptTestCase::testAttachedLibrary
. The tests are implemented independently ofJavaScriptTestCase::testAttachedLibrary
becausedrupal_process_attached
treats #attached[library] differently than #attached[css] and #attached[js], but treats the latter two similarly.This patch tests attaching javascript and css by setting string and array values for #attached[css/js]. More extensive options testing is not implemented since this feature basically serves as a wrapper for drupal_add_js and drupal_add_css. Further testing relevant to those functions need not be re-tested in this context.
Comment #8
sunWe absolutely need to test all variations, i.e. 'library', 'js', and 'css', especially adding more than one of each, and using all the different options to ensure they are properly passed on to drupal_add_*() functions.
I mention more than one, because there seems to be a bug with attached JS settings... #645822-8: #ajax is not extensible (and partially buggy)
Comment #9
sun.core CreditAttribution: sun.core commentedTests don't qualify as critical.