diff --git a/tests/lib/Files/Storage/Storage.php b/tests/lib/Files/Storage/Storage.php index 63b3dfc5a98..780374417b8 100644 --- a/tests/lib/Files/Storage/Storage.php +++ b/tests/lib/Files/Storage/Storage.php @@ -243,12 +243,14 @@ abstract class Storage extends \Test\TestCase { public function testMove($source, $target) { $this->initSourceAndTarget($source); + $mTime = $this->instance->filemtime($source); $this->instance->rename($source, $target); $this->wait(); $this->assertTrue($this->instance->file_exists($target), $target . ' was not created'); $this->assertFalse($this->instance->file_exists($source), $source . ' still exists'); $this->assertSameAsLorem($target); + $this->assertEquals($mTime, $this->instance->filemtime($target), 'mtime was not preserved by move'); } /** @@ -271,11 +273,13 @@ abstract class Storage extends \Test\TestCase { public function testMoveOverwrite($source, $target) { $this->initSourceAndTarget($source, $target); + $mTime = $this->instance->filemtime($source); $this->instance->rename($source, $target); $this->assertTrue($this->instance->file_exists($target), $target . ' was not created'); $this->assertFalse($this->instance->file_exists($source), $source . ' still exists'); $this->assertSameAsLorem($target); + $this->assertEquals($mTime, $this->instance->filemtime($target), 'mtime was not preserved by move'); } public function testLocal() { @@ -485,6 +489,10 @@ abstract class Storage extends \Test\TestCase { $this->instance->file_put_contents('source/test2.txt', 'qwerty'); $this->instance->mkdir('source/subfolder'); $this->instance->file_put_contents('source/subfolder/test.txt', 'bar'); + + $mTimeDirectory = $this->instance->filemtime('source'); + $mTimeTestFile = $this->instance->filemtime('source/subfolder/test.txt'); + $this->instance->rename('source', 'target'); $this->assertFalse($this->instance->file_exists('source')); @@ -505,6 +513,8 @@ abstract class Storage extends \Test\TestCase { $this->assertEquals('foo', $this->instance->file_get_contents('target/test1.txt')); $this->assertEquals('qwerty', $this->instance->file_get_contents('target/test2.txt')); $this->assertEquals('bar', $this->instance->file_get_contents('target/subfolder/test.txt')); + $this->assertEquals($mTimeDirectory, $this->instance->filemtime('target'), 'directory mtime was not preserved by rename'); + $this->assertEquals($mTimeTestFile, $this->instance->filemtime('target/subfolder/test.txt'), 'file mtime was not preserved by rename'); } public function testRenameOverWriteDirectory() {