Problems testing function url() with statics

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by R.Muilwijk on October 24, 2008 at 7:48am

For one of the testing party issues I ran across a problem trying to test the url function. The issue is located here:
http://drupal.org/node/296324

As posted over there my question is this:

I'm having problems doing this test... the problem is in the code of url:

static $script;
static $clean_url;

if (!isset($script)) {
// On some web servers, such as IIS, we can't omit "index.php". So, we
// generate "index.php?q=foo" instead of "?q=foo" on anything that is not
// Apache.
$script = (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') === FALSE) ? 'index.php' : '';
}

// Cache the clean_url variable to improve performance.
if (!isset($clean_url)) {
$clean_url = (bool)variable_get('clean_url', '0');
}

as you can see $script and $clean_url are saved in a static which means this function can only be tested in different page loads with fake modules or something.. is that the way to go?

Categories:

Testing and Quality Assurance

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

AltStyle によって変換されたページ (->オリジナル) /