Author: Tobias Schlitt
Date: 2007-05-05 21:47:16 +0200 (Sat, 05 May 2007)
New Revision: 5066

Log:
- Added test for restore without search.
# Fixed issue #10577: ezcCacheStorageFile::restore searches for files and
# returns the wrong data.

Modified:
   trunk/Cache/ChangeLog
   trunk/Cache/tests/storage_file_test.php

Modified: trunk/Cache/ChangeLog
===================================================================
--- trunk/Cache/ChangeLog       2007-05-05 14:52:48 UTC (rev 5065)
+++ trunk/Cache/ChangeLog       2007-05-05 19:47:16 UTC (rev 5066)
@@ -4,6 +4,8 @@
 - Implemented issue #9383: Ability to set file permissions on created files.
 - Added ezcCacheStorageFileOptions class.
 - Fixed issue #10678: ezcCacheStorageOptions throws incorrect exceptions.
+- Fixed issue #10577: ezcCacheStorageFile::restore searches for files and
+  returns the wrong data.
 
 
 1.1.4 - Monday 18 December 2006

Modified: trunk/Cache/tests/storage_file_test.php
===================================================================
--- trunk/Cache/tests/storage_file_test.php     2007-05-05 14:52:48 UTC (rev 
5065)
+++ trunk/Cache/tests/storage_file_test.php     2007-05-05 19:47:16 UTC (rev 
5066)
@@ -170,6 +170,37 @@
         $this->removeTempDir();
     }
 
+    public function testRestoreWithoutSearch()
+    {
+        $cache = new ezcCacheStorageFileArray(
+            $this->createTempDir( 'ezcCacheStorageFileTest' ), 
+            array( 'extension' => '.c', 'ttl' => false )
+        );
+
+        $id = "test";
+        $keys = array( 10000, 1, 10, 100, 1000 );
+        
+        // Store
+        foreach ( $keys as $key )
+        {
+            // No cache may exist!
+            $this->assertFalse(
+                $cache->restore( $id, array( 0 => $key, 1 => "en" ), false )
+            );
+            $cache->store( $id, "ID=$key&LANG=en", array( 0 => $key, 1 => "en" 
) );
+        }
+
+        // Restore
+        foreach( $keys as $key )
+        {
+            $this->assertEquals(
+                $cache->restore( $id, array( 0 => $key, 1 => "en" ), false ),
+                "ID=$key&LANG=en"
+            );
+        }
+
+    }
+
     public static function suite()
     {
          return new PHPUnit_Framework_TestSuite( "ezcCacheStorageFileTest" );

-- 
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to