summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-03-03 11:14:45 +0100
committerVincent Petry <pvince81@owncloud.com>2015-03-25 18:33:21 +0100
commitec2d7cff2f36fb37ea6348022bbba09430ac3b9f (patch)
treec601cbabb326a99932a02d6c2e67b6209d7c9cff /tests
parentc6494034c81c6bf60c9dd3517fe5243f035d48f4 (diff)
downloadnextcloud-server-ec2d7cff2f36fb37ea6348022bbba09430ac3b9f.tar.gz
nextcloud-server-ec2d7cff2f36fb37ea6348022bbba09430ac3b9f.zip
SQLite autoincrement test
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/cache/cache.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/lib/files/cache/cache.php b/tests/lib/files/cache/cache.php
index 1bf838351b6..f0ad6cf3ab1 100644
--- a/tests/lib/files/cache/cache.php
+++ b/tests/lib/files/cache/cache.php
@@ -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();