]> source.dussan.org Git - nextcloud-server.git/commitdiff
make storage directory test be a bit less strict about mtimes 43399/head
authorRobin Appelman <robin@icewind.nl>
Tue, 6 Feb 2024 16:44:23 +0000 (17:44 +0100)
committerRobin Appelman <robin@icewind.nl>
Wed, 7 Feb 2024 11:13:00 +0000 (12:13 +0100)
sometimes the clock ticks over during the test

Signed-off-by: Robin Appelman <robin@icewind.nl>
tests/lib/Files/Storage/Storage.php

index a646fd5fd0ba400548b5db6ac9315c4d1e3135d0..63b3dfc5a984322218293861c5d864909245833d 100644 (file)
@@ -94,12 +94,13 @@ abstract class Storage extends \Test\TestCase {
                $dirEntry = $content[0];
                unset($dirEntry['scan_permissions']);
                unset($dirEntry['etag']);
+               $this->assertLessThanOrEqual(1, abs($dirEntry['mtime'] - $this->instance->filemtime($directory)));
+               unset($dirEntry['mtime']);
+               unset($dirEntry['storage_mtime']);
                $this->assertEquals([
                        'name' => $directory,
                        'mimetype' => $this->instance->getMimeType($directory),
-                       'mtime' => $this->instance->filemtime($directory),
                        'size' => -1,
-                       'storage_mtime' => $this->instance->filemtime($directory),
                        'permissions' => $this->instance->getPermissions($directory),
                ], $dirEntry);