Call drupal_add_css for a CSS with module and theme type, at least two media, preprocess TRUE/FALSE and assert the return value at the last call. Don't forget to check that an RTL CSS file is added as well if present.

Comments

jerdavis’s picture

StatusFileSize
new2.6 KB

Test created by Ryan Szrama and Jer Davis - Testing all cases:

Stylesheet added using default parameters; media = all, type = module, preprocess = TRUE
Stylesheet added to mobile media with preprocess.
Stylesheet added to print media without preprocess.
Stylesheet added to print media without preprocess.
Right-to-left stylesheet added to print media without preprocess.

Hungarian pancakes rock!

rszrama’s picture

Subscribe in case we need to tweak the patch.

webchick’s picture

Status: Active » Needs review
sime’s picture

StatusFileSize
new3.01 KB

Hey this patch applied and worked great, and i would say rtbc, but I thought it was worth adding a little assertTrue to see if one of the files got through to the theme layer, ie. from drupal_get_css().

I thought about trying to test the preprocess logic, but this I think should be tested separately.

Status: Needs review » Needs work

The last submitted patch failed testing.

lilou’s picture

Status: Needs work » Needs review
catch’s picture

Status: Needs review » Needs work

We no longer have phpdoc for setUp(), getInfo() or tearDown()
http://drupal.org/node/325974

catch’s picture

Component: tests » base system
Category: bug » task
Priority: Critical » Normal

Moving this out of the critical bugs queue - see #607038: Meta issue: fix gaps in code coverage.

It's possible tests got added for this as part of the drupal_add_* revamp spree.

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.