Storage: remove some unneeded strict tests of mtime behaviour
This commit is contained in:
parent
97f0bc1c4a
commit
cfac7fcd53
1 changed files with 2 additions and 21 deletions
|
@ -180,31 +180,12 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
|
|||
$this->assertEquals($stat['size'], $this->instance->filesize('/lorem.txt'));
|
||||
$this->assertEquals($stat['mtime'], $mTime);
|
||||
|
||||
$mtimeStart = time();
|
||||
$supportsTouch = $this->instance->touch('/lorem.txt');
|
||||
$mtimeEnd = time();
|
||||
if ($supportsTouch !== false) {
|
||||
if ($this->instance->touch('/lorem.txt', 100) !== false) {
|
||||
$mTime = $this->instance->filemtime('/lorem.txt');
|
||||
$this->assertTrue(($mtimeStart - 1) <= $mTime);
|
||||
$this->assertTrue($mTime <= ($mtimeEnd + 1));
|
||||
|
||||
$this->assertTrue($this->instance->hasUpdated('/lorem.txt', $mtimeStart - 1));
|
||||
|
||||
if ($this->instance->touch('/lorem.txt', 100) !== false) {
|
||||
$mTime = $this->instance->filemtime('/lorem.txt');
|
||||
$this->assertEquals($mTime, 100);
|
||||
}
|
||||
$this->assertEquals($mTime, 100);
|
||||
}
|
||||
|
||||
$mtimeStart = time();
|
||||
$fh = $this->instance->fopen('/lorem.txt', 'a');
|
||||
fwrite($fh, ' ');
|
||||
fclose($fh);
|
||||
clearstatcache();
|
||||
$mtimeEnd = time();
|
||||
$mTime = $this->instance->filemtime('/lorem.txt');
|
||||
$this->assertTrue(($mtimeStart - 1) <= $mTime);
|
||||
$this->assertTrue($mTime <= ($mtimeEnd + 1));
|
||||
|
||||
$this->instance->unlink('/lorem.txt');
|
||||
$this->assertTrue($this->instance->hasUpdated('/', $mtimeStart - 1));
|
||||
|
|
Loading…
Reference in a new issue