Merge pull request #11485 from brumsoel/master

Fix timestamp comparator return value
This commit is contained in:
Lukas Reschke 2014-12-05 19:53:09 +01:00
commit 116a1b366a
2 changed files with 3 additions and 3 deletions

View File

@ -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;
}
/**

View File

@ -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),
);