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