]> source.dussan.org Git - nextcloud-server.git/commitdiff
SQLite autoincrement test
authorVincent Petry <pvince81@owncloud.com>
Tue, 3 Mar 2015 10:14:45 +0000 (11:14 +0100)
committerVincent Petry <pvince81@owncloud.com>
Wed, 25 Mar 2015 17:33:21 +0000 (18:33 +0100)
tests/lib/files/cache/cache.php

index 1bf838351b6db4e6b23bd0314808de69ecb4ea9c..f0ad6cf3ab123eb38e4202fbbb3bd161688de0db 100644 (file)
@@ -594,6 +594,19 @@ class Cache extends \Test\TestCase {
                $this->assertEquals($newData, $newDataFromBogus);
        }
 
+       public function testNoReuseOfFileId() {
+               $data1 = array('size' => 100, 'mtime' => 50, 'mimetype' => 'text/plain');
+               $this->cache->put('somefile.txt', $data1);
+               $info = $this->cache->get('somefile.txt');
+               $fileId = $info['fileid'];
+               $this->cache->remove('somefile.txt');
+               $data2 = array('size' => 200, 'mtime' => 100, 'mimetype' => 'text/plain');
+               $this->cache->put('anotherfile.txt', $data2);
+               $info2 = $this->cache->get('anotherfile.txt');
+               $fileId2 = $info2['fileid'];
+               $this->assertNotEquals($fileId, $fileId2);
+       }
+
        protected function tearDown() {
                if ($this->cache) {
                        $this->cache->clear();