add tests for index cache
authorChuck Hagenbuch <chuck@horde.org>
Sun, 4 Jan 2009 17:41:36 +0000 (12:41 -0500)
committerChuck Hagenbuch <chuck@horde.org>
Sun, 4 Jan 2009 17:41:36 +0000 (12:41 -0500)
framework/Db/test/Horde/Db/Adapter/MysqliTest.php
framework/Db/test/Horde/Db/Adapter/Pdo/MysqlTest.php
framework/Db/test/Horde/Db/Adapter/Pdo/PgsqlTest.php
framework/Db/test/Horde/Db/Adapter/Pdo/SqliteTest.php

index 0a31f0b..006e8e0 100644 (file)
@@ -809,10 +809,22 @@ class Horde_Db_Adapter_MysqliTest extends PHPUnit_Framework_TestCase
 
 
     /*##########################################################################
-    # Test Cached table descriptions
+    # Test table cache
     ##########################################################################*/
 
-    public function testCachedTableDescription()
+    public function testCachedTableIndexes()
+    {
+        // remove any current cache.
+        $this->_cache->set('tables/indexes/cache_table', '');
+        $this->assertEquals('', $this->_cache->get('tables/indexes/cache_table'));
+
+        $this->_createTestTable('cache_table');
+        $idxs = $this->_conn->indexes('cache_table');
+
+        $this->assertNotEquals('', $this->_cache->get('tables/indexes/cache_table'));
+    }
+
+    public function testCachedTableColumns()
     {
         // remove any current cache.
         $this->_cache->set('tables/columns/cache_table', '');
index 7f3652b..212b55a 100644 (file)
@@ -809,10 +809,22 @@ class Horde_Db_Adapter_Pdo_MysqlTest extends PHPUnit_Framework_TestCase
 
 
     /*##########################################################################
-    # Test Cached table descriptions
+    # Test table cache
     ##########################################################################*/
 
-    public function testCachedTableDescription()
+    public function testCachedTableIndexes()
+    {
+        // remove any current cache.
+        $this->_cache->set('tables/indexes/cache_table', '');
+        $this->assertEquals('', $this->_cache->get('tables/indexes/cache_table'));
+
+        $this->_createTestTable('cache_table');
+        $idxs = $this->_conn->indexes('cache_table');
+
+        $this->assertNotEquals('', $this->_cache->get('tables/indexes/cache_table'));
+    }
+
+    public function testCachedTableColumns()
     {
         // remove any current cache.
         $this->_cache->set('tables/columns/cache_table', '');
index f0331e0..6744842 100644 (file)
@@ -781,10 +781,22 @@ class Horde_Db_Adapter_Pdo_PgsqlTest extends PHPUnit_Framework_TestCase
 
 
     /*##########################################################################
-    # Test Cached table descriptions
+    # Test table cache
     ##########################################################################*/
 
-    public function testCachedTableDescription()
+    public function testCachedTableIndexes()
+    {
+        // remove any current cache.
+        $this->_cache->set('tables/indexes/cache_table', '');
+        $this->assertEquals('', $this->_cache->get('tables/indexes/cache_table'));
+
+        $this->_createTestTable('cache_table');
+        $idxs = $this->_conn->indexes('cache_table');
+
+        $this->assertNotEquals('', $this->_cache->get('tables/indexes/cache_table'));
+    }
+
+    public function testCachedTableColumns()
     {
         // remove any current cache.
         $this->_cache->set('tables/columns/cache_table', '');
index a89bcc2..04d763c 100644 (file)
@@ -825,11 +825,24 @@ class Horde_Db_Adapter_Pdo_SqliteTest extends PHPUnit_Framework_TestCase
         $this->assertEquals('SELECT * FROM documents ORDER BY name DESC', $result);
     }
 
+
     /*##########################################################################
-    # Test Cached table descriptions
+    # Test table cache
     ##########################################################################*/
 
-    public function testCachedTableDescription()
+    public function testCachedTableIndexes()
+    {
+        // remove any current cache.
+        $this->_cache->set('tables/indexes/cache_table', '');
+        $this->assertEquals('', $this->_cache->get('tables/indexes/cache_table'));
+
+        $this->_createTestTable('cache_table');
+        $idxs = $this->_conn->indexes('cache_table');
+
+        $this->assertNotEquals('', $this->_cache->get('tables/indexes/cache_table'));
+    }
+
+    public function testCachedTableColumns()
     {
         // remove any current cache.
         $this->_cache->set('tables/columns/cache_table', '');