When used to perform tests with clean URLs disabled during the test, and to click on a link to a drupal file (like an README.txt in a module) instead of a drupal-generated path, the link is incorrectly being generated as if it were to a drupal path, i.e. with in "?q= " format, like ?q=sites/all/modules/foo/README.txt instead of just sites/all/modules/foo/README.txt

This is because it relies on DrupalWebTestCase::getAbsoluteUrl which does not include a test for matching files, which itself relies on url(), which does not include such detection, as noted on #1009120: url() fails on files without clean URLs. Without a fix like the D7 'script' option available in D6, getAbsoluteUrl() should test whether the path is a file or not and, if it is, build a file URL instead of relying on url().

Comments

dave reid’s picture

Status: Active » Fixed

Build the full URL yourself and getAbsoluteUrl won't touch it.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.