From 61f4dfc982fc6c1c20377691e2adfb3e4c5f68f9 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 16 May 2009 19:07:02 +0000 Subject: - Patch #456824 by catch: add better caching to drupal_lookup_path(). --- modules/path/path.test | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'modules/path') diff --git a/modules/path/path.test b/modules/path/path.test index f13b12fcd..421f58247 100644 --- a/modules/path/path.test +++ b/modules/path/path.test @@ -26,6 +26,31 @@ class PathTestCase extends DrupalWebTestCase { $this->drupalLogin($web_user); } + /** + * Test the path cache. + */ + function testPathCache() { + // Create test node. + $node1 = $this->drupalCreateNode(); + + // Create alias. + $edit = array(); + $edit['src'] = 'node/' . $node1->nid; + $edit['dst'] = $this->randomName(8); + $this->drupalPost('admin/build/path/add', $edit, t('Create new alias')); + + // Visit the system path for the node and confirm a cache entry is + // created. + cache_clear_all('*', 'cache_path', TRUE); + $this->drupalGet($edit['src']); + $this->assertTrue(cache_get($edit['src'], 'cache_path'), t('Cache entry was created.')); + + // Visit the alias for the node and confirm a cache entry is created. + cache_clear_all('*', 'cache_path', TRUE); + $this->drupalGet($edit['dst']); + $this->assertTrue(cache_get($edit['src'], 'cache_path'), t('Cache entry was created.')); + } + /** * Test alias functionality through the admin interfaces. */ -- cgit v1.2.3