Skip to content
Snippets Groups Projects
Commit 116a1b36 authored by Lukas Reschke's avatar Lukas Reschke
Browse files

Merge pull request #11485 from brumsoel/master

Fix timestamp comparator return value
parents 941a983d 0dcfd5f2
No related branches found
No related tags found
No related merge requests found
......@@ -82,7 +82,7 @@ class Helper
public static function compareTimestamp(FileInfo $a, FileInfo $b) {
$aTime = $a->getMTime();
$bTime = $b->getMTime();
return $aTime - $bTime;
return ($aTime < $bTime) ? -1 : 1;
}
/**
......
......@@ -33,10 +33,10 @@ class Test_Files_Helper extends \Test\TestCase {
*/
private function getTestFileList() {
return array(
self::makeFileInfo('a.txt', 4, 1000),
self::makeFileInfo('a.txt', 4, 2.3 * pow(10, 9)),
self::makeFileInfo('q.txt', 5, 150),
self::makeFileInfo('subdir2', 87, 128, true),
self::makeFileInfo('b.txt', 166, 800),
self::makeFileInfo('b.txt', 2.2 * pow(10, 9), 800),
self::makeFileInfo('o.txt', 12, 100),
self::makeFileInfo('subdir', 88, 125, true),
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment