skip some test for storage backends that don't support touch
This commit is contained in:
parent
a203a4a1c7
commit
f5b62fb2eb
1 changed files with 15 additions and 13 deletions
|
@ -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,' ');
|
||||
|
|
Loading…
Reference in a new issue