]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix tests
authorRobin Appelman <icewind@owncloud.com>
Wed, 2 Dec 2015 14:20:12 +0000 (15:20 +0100)
committerRobin Appelman <icewind@owncloud.com>
Thu, 14 Jan 2016 11:54:42 +0000 (12:54 +0100)
tests/lib/files/cache/cache.php
tests/lib/files/cache/scanner.php

index d674ac27fa11835243714d7a08062821931667f2..de4ae9cd8e9762a16ffa72ffad49543f73b47507 100644 (file)
@@ -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"
index 8186fe29493647f8fb425263e020bbf4bf1dcb13..b1eb3f589e898e99b2f69c4176559dec26ea4971 100644 (file)
@@ -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);