fix tests

This commit is contained in:
Robin Appelman 2015-12-02 15:20:12 +01:00
parent dcbeeced3b
commit 62d383e1ba
2 changed files with 4 additions and 2 deletions

View 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"

View 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);