While trying to write a simpletest to check some path aliasing issues, I discovered that drupal_lookup_path() breaks when called in a test.

Namely, it always returns NULL. I've tracked down the culprit to current_path(), which returns path/to/content in the browser, but instead returns batch when called from within Simpletest.

Since drupal_lookup_path() uses the output of current_path() to generate the $cache[map] variable that it uses to find and store the path alias, this prevents drupal_lookup_path() from working in tests.

I have no idea how to fix it though.

Comments

Version: 7.19 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.