mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
tests: Add test for CacheEntry getters
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
f3fa006484
commit
5b37d6d9ff
1 changed files with 25 additions and 0 deletions
|
|
@ -98,6 +98,31 @@ class CacheTest extends \Test\TestCase {
|
|||
$this->assertEquals($cacheData1, $this->cache->get($id1));
|
||||
}
|
||||
|
||||
public function testCacheEntryGetters() {
|
||||
$file1 = 'foo';
|
||||
$data1 = ['size' => 100, 'mtime' => 50, 'mimetype' => 'foo/file'];
|
||||
|
||||
$id1 = $this->cache->put($file1, $data1);
|
||||
$entry = $this->cache->get($file1);
|
||||
|
||||
$this->assertEquals($entry->getId(), $id1);
|
||||
$this->assertEquals($entry->getStorageId(), $this->cache->getNumericStorageId());
|
||||
$this->assertEquals($entry->getPath(), 'foo');
|
||||
$this->assertEquals($entry->getName(), 'foo');
|
||||
$this->assertEquals($entry->getMimeType(), 'foo/file');
|
||||
$this->assertEquals($entry->getMimePart(), 'foo');
|
||||
$this->assertEquals($entry->getSize(), 100);
|
||||
$this->assertEquals($entry->getMTime(), 50);
|
||||
$this->assertEquals($entry->getStorageMTime(), 50);
|
||||
$this->assertEquals($entry->getEtag(), null);
|
||||
$this->assertEquals($entry->getPermissions(), 0);
|
||||
$this->assertEquals($entry->isEncrypted(), false);
|
||||
$this->assertEquals($entry->getMetadataEtag(), null);
|
||||
$this->assertEquals($entry->getCreationTime(), null);
|
||||
$this->assertEquals($entry->getUploadTime(), null);
|
||||
$this->assertEquals($entry->getUnencryptedSize(), 100);
|
||||
}
|
||||
|
||||
public function testPartial() {
|
||||
$file1 = 'foo';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue