summaryrefslogtreecommitdiff
path: root/modules/path
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-07-31 04:10:30 +0000
committerDries Buytaert <dries@buytaert.net>2010-07-31 04:10:30 +0000
commita94519077bae9c7a38c20cd8d46dc76805110ad1 (patch)
treedba8f8bb0fd37512bc7e6f60b59afdb9242a2e5c /modules/path
parent699afdd1be4b8034c36474c7191972604bf5f54e (diff)
downloadbrdo-a94519077bae9c7a38c20cd8d46dc76805110ad1.tar.gz
brdo-a94519077bae9c7a38c20cd8d46dc76805110ad1.tar.bz2
- Patch #829968 by andypost, AlexisWilke: drupal_lookup_path() documentation and return mismatch.
Diffstat (limited to 'modules/path')
-rw-r--r--modules/path/path.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/path/path.test b/modules/path/path.test
index a777871ca..6584eda6b 100644
--- a/modules/path/path.test
+++ b/modules/path/path.test
@@ -346,6 +346,22 @@ class PathLanguageTestCase extends DrupalWebTestCase {
// should keep working.
$this->drupalGet($french_alias);
$this->assertResponse(404, t('Alias for French translation is unavailable when URL language negotiation is disabled.'));
+
+ // drupal_lookup_path() has an internal static cache. Check to see that
+ // it has the appropriate contents at this point.
+ drupal_lookup_path('wipe');
+ $french_node_path = drupal_lookup_path('source', $french_alias, $french_node->language);
+ $this->assertEqual($french_node_path, 'node/' . $french_node->nid, t('Normal path works.'));
+ // Second call should return the same path.
+ $french_node_path = drupal_lookup_path('source', $french_alias, $french_node->language);
+ $this->assertEqual($french_node_path, 'node/' . $french_node->nid, t('Normal path is the same.'));
+
+ // Confirm that the alias works.
+ $french_node_alias = drupal_lookup_path('alias', 'node/' . $french_node->nid, $french_node->language);
+ $this->assertEqual($french_node_alias, $french_alias, t('Alias works.'));
+ // Second call should return the same alias.
+ $french_node_alias = drupal_lookup_path('alias', 'node/' . $french_node->nid, $french_node->language);
+ $this->assertEqual($french_node_alias, $french_alias, t('Alias is the same.'));
}
}