diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-10-06 13:45:46 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-10-06 13:45:46 +0200 |
commit | f5b62fb2eb10f23109bf1b1e8a3a6d0c8b0c67e4 (patch) | |
tree | 3b1b239576e9eba42518d44307bcd518e972811c /tests | |
parent | a203a4a1c772bc05750f0bbe2db701c21cae6855 (diff) | |
download | nextcloud-server-f5b62fb2eb10f23109bf1b1e8a3a6d0c8b0c67e4.tar.gz nextcloud-server-f5b62fb2eb10f23109bf1b1e8a3a6d0c8b0c67e4.zip |
skip some test for storage backends that don't support touch
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/filestorage.php | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/tests/lib/filestorage.php b/tests/lib/filestorage.php index 3f7bb7b62dc..101da0d1ada 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,' '); |