summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-01-15 12:02:31 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-01-15 12:02:31 +0100
commit52040a3f237390baab75908150dcb12fba7e5411 (patch)
treea63b4004ad1bf2950ee8a2a507a92b367e319c3f /tests
parentcd840f01ae30e31a195d1f8eb15ef2d58dba3a7a (diff)
parent7530f66f52308cb2f24478495fcffdd44ce3db41 (diff)
downloadnextcloud-server-52040a3f237390baab75908150dcb12fba7e5411.tar.gz
nextcloud-server-52040a3f237390baab75908150dcb12fba7e5411.zip
Merge pull request #20898 from owncloud/cache-interfaces
Public Cache interfaces
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/files/cache/cache.php2
-rw-r--r--tests/lib/files/cache/scanner.php4
-rw-r--r--tests/lib/files/storage/wrapper/quota.php4
3 files changed, 7 insertions, 3 deletions
diff --git a/tests/lib/files/cache/cache.php b/tests/lib/files/cache/cache.php
index d674ac27fa1..de4ae9cd8e9 100644
--- a/tests/lib/files/cache/cache.php
+++ b/tests/lib/files/cache/cache.php
@@ -556,7 +556,7 @@ class Cache extends \Test\TestCase {
$this->assertEquals($folderWith00F6, $unNormalizedFolderName['name']);
// put normalized folder
- $this->assertTrue(is_array($this->cache->get('folder/' . $folderWith00F6)));
+ $this->assertInstanceOf('\OCP\Files\Cache\ICacheEntry', $this->cache->get('folder/' . $folderWith00F6));
$this->assertGreaterThan(0, $this->cache->put('folder/' . $folderWith00F6, $data));
// at this point we should have only one folder named "Schön"
diff --git a/tests/lib/files/cache/scanner.php b/tests/lib/files/cache/scanner.php
index 8186fe29493..b1eb3f589e8 100644
--- a/tests/lib/files/cache/scanner.php
+++ b/tests/lib/files/cache/scanner.php
@@ -7,6 +7,7 @@
*/
namespace Test\Files\Cache;
+use OC\Files\Cache\CacheEntry;
/**
* Class Scanner
@@ -226,6 +227,7 @@ class Scanner extends \Test\TestCase {
// manipulate etag to simulate an empty etag
$this->scanner->scan('', \OC\Files\Cache\Scanner::SCAN_SHALLOW, \OC\Files\Cache\Scanner::REUSE_ETAG);
+ /** @var CacheEntry $data0 */
$data0 = $this->cache->get('folder/bar.txt');
$this->assertInternalType('string', $data0['etag']);
$data1 = $this->cache->get('folder');
@@ -233,7 +235,7 @@ class Scanner extends \Test\TestCase {
$data2 = $this->cache->get('');
$this->assertInternalType('string', $data2['etag']);
$data0['etag'] = '';
- $this->cache->put('folder/bar.txt', $data0);
+ $this->cache->put('folder/bar.txt', $data0->getData());
// rescan
$this->scanner->scan('folder/bar.txt', \OC\Files\Cache\Scanner::SCAN_SHALLOW, \OC\Files\Cache\Scanner::REUSE_ETAG);
diff --git a/tests/lib/files/storage/wrapper/quota.php b/tests/lib/files/storage/wrapper/quota.php
index 95bc2ff7a1a..d087a3eef33 100644
--- a/tests/lib/files/storage/wrapper/quota.php
+++ b/tests/lib/files/storage/wrapper/quota.php
@@ -9,6 +9,8 @@
namespace Test\Files\Storage\Wrapper;
//ensure the constants are loaded
+use OC\Files\Cache\CacheEntry;
+
\OC::$loader->load('\OC\Files\Filesystem');
/**
@@ -194,7 +196,7 @@ class Quota extends \Test\Files\Storage\Storage {
$cache->expects($this->once())
->method('get')
->with('files')
- ->will($this->returnValue(array('size' => 50)));
+ ->will($this->returnValue(new CacheEntry(['size' => 50])));
$instance = new \OC\Files\Storage\Wrapper\Quota(array('storage' => $storage, 'quota' => 1024, 'root' => 'files'));