diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-24 01:01:36 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-07-24 01:01:36 +0200 |
commit | c517c845f6c4d1199e1485adb8947e01602659e5 (patch) | |
tree | c587821a0440db48808c64ddcfbd1fa2c5451efe /tests/lib/files | |
parent | cfac7fcd53974ddf20ddb75a0cb3b5a73047568a (diff) | |
parent | 5fc0535f1b6d94140eed2234e4cb6e38219a74d1 (diff) | |
download | nextcloud-server-c517c845f6c4d1199e1485adb8947e01602659e5.tar.gz nextcloud-server-c517c845f6c4d1199e1485adb8947e01602659e5.zip |
Merge branch 'master' into storage-test-cleanup
Conflicts:
tests/lib/files/storage/storage.php
Diffstat (limited to 'tests/lib/files')
-rw-r--r-- | tests/lib/files/storage/storage.php | 8 | ||||
-rw-r--r-- | tests/lib/files/view.php | 9 |
2 files changed, 13 insertions, 4 deletions
diff --git a/tests/lib/files/storage/storage.php b/tests/lib/files/storage/storage.php index 46818c3b4a1..3f339a10016 100644 --- a/tests/lib/files/storage/storage.php +++ b/tests/lib/files/storage/storage.php @@ -168,10 +168,10 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $this->assertTrue($this->instance->isReadable('/lorem.txt')); $ctimeEnd = time(); $mTime = $this->instance->filemtime('/lorem.txt'); - $this->assertTrue($this->instance->hasUpdated('/lorem.txt', $ctimeStart - 1)); - $this->assertTrue($this->instance->hasUpdated('/', $ctimeStart - 1)); + $this->assertTrue($this->instance->hasUpdated('/lorem.txt', $ctimeStart - 5)); + $this->assertTrue($this->instance->hasUpdated('/', $ctimeStart - 5)); - $this->assertTrue(($ctimeStart - 1) <= $mTime); + $this->assertTrue(($ctimeStart - 5) <= $mTime); $this->assertTrue($mTime <= ($ctimeEnd + 1)); $this->assertEquals(filesize($textFile), $this->instance->filesize('/lorem.txt')); @@ -188,7 +188,7 @@ abstract class Storage extends \PHPUnit_Framework_TestCase { $mtimeStart = time(); $this->instance->unlink('/lorem.txt'); - $this->assertTrue($this->instance->hasUpdated('/', $mtimeStart - 1)); + $this->assertTrue($this->instance->hasUpdated('/', $mtimeStart - 5)); } public function testFOpen() { diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php index 830913a91ad..3bac9e770aa 100644 --- a/tests/lib/files/view.php +++ b/tests/lib/files/view.php @@ -20,10 +20,19 @@ class View extends \PHPUnit_Framework_TestCase { private $storages = array(); public function setUp() { + \OC_User::clearBackends(); + \OC_User::useBackend(new \OC_User_Dummy()); + + //login + \OC_User::createUser('test', 'test'); + $this->user=\OC_User::getUser(); + \OC_User::setUserId('test'); + \OC\Files\Filesystem::clearMounts(); } public function tearDown() { + \OC_User::setUserId($this->user); foreach ($this->storages as $storage) { $cache = $storage->getCache(); $ids = $cache->getAll(); |