mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
SQLite autoincrement test
This commit is contained in:
parent
c6494034c8
commit
ec2d7cff2f
1 changed files with 13 additions and 0 deletions
13
tests/lib/files/cache/cache.php
vendored
13
tests/lib/files/cache/cache.php
vendored
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue