summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-10-08 13:39:01 +0200
committerRobin Appelman <icewind@owncloud.com>2012-10-08 13:39:01 +0200
commit2de94f9c8574d8662bf0993999ca2f7bbff1f115 (patch)
tree58b8f98c301a55f0fcce1288884d06744886ed89 /tests
parentc4c8dd4e3a5fcd9a86835566db954662dcb41a0c (diff)
parent3affeb5bd77715c84c70230d744de8d0f577a378 (diff)
downloadnextcloud-server-2de94f9c8574d8662bf0993999ca2f7bbff1f115.tar.gz
nextcloud-server-2de94f9c8574d8662bf0993999ca2f7bbff1f115.zip
merge master into phpunit
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/filestorage.php28
-rw-r--r--tests/lib/filesystem.php2
2 files changed, 16 insertions, 14 deletions
diff --git a/tests/lib/filestorage.php b/tests/lib/filestorage.php
index 4431abe83c7..ae780bee85a 100644
--- a/tests/lib/filestorage.php
+++ b/tests/lib/filestorage.php
@@ -176,22 +176,24 @@ abstract class Test_FileStorage extends UnitTestCase {
$this->assertEqual($stat['ctime'],$cTime);
$mtimeStart=time();
- $this->instance->touch('/lorem.txt');
+ $supportsTouch = $this->instance->touch('/lorem.txt');
$mtimeEnd=time();
- $originalCTime=$cTime;
- $cTime=$this->instance->filectime('/lorem.txt');
- $mTime=$this->instance->filemtime('/lorem.txt');
- $this->assertTrue(($mtimeStart-1)<=$mTime);
- $this->assertTrue($mTime<=($mtimeEnd+1));
- $this->assertEqual($cTime,$originalCTime);
-
- $this->assertTrue($this->instance->hasUpdated('/lorem.txt',$mtimeStart-1));
-
- if($this->instance->touch('/lorem.txt',100)!==false) {
+ if($supportsTouch !== false){
+ $originalCTime=$cTime;
+ $cTime=$this->instance->filectime('/lorem.txt');
$mTime=$this->instance->filemtime('/lorem.txt');
- $this->assertEqual($mTime,100);
+ $this->assertTrue(($mtimeStart-1)<=$mTime);
+ $this->assertTrue($mTime<=($mtimeEnd+1));
+ $this->assertEqual($cTime,$originalCTime);
+
+ $this->assertTrue($this->instance->hasUpdated('/lorem.txt',$mtimeStart-1));
+
+ if($this->instance->touch('/lorem.txt',100)!==false) {
+ $mTime=$this->instance->filemtime('/lorem.txt');
+ $this->assertEqual($mTime,100);
+ }
}
-
+
$mtimeStart=time();
$fh=$this->instance->fopen('/lorem.txt','a');
fwrite($fh,' ');
diff --git a/tests/lib/filesystem.php b/tests/lib/filesystem.php
index 315471e8555..e22b3f1c0d8 100644
--- a/tests/lib/filesystem.php
+++ b/tests/lib/filesystem.php
@@ -73,7 +73,7 @@ class Test_Filesystem extends UnitTestCase {
}
public function testHooks() {
- if(OC_User::isLoggedIn()){
+ if(OC_Filesystem::getView()){
$user = OC_User::getUser();
}else{
$user=uniqid();