diff --git a/typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php b/typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
index f453d4b4a0688dd0e5ba035959f127ad30e27860..212da7d47ad87882834a21d592f2e84ea2786b52 100644
--- a/typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
+++ b/typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
@@ -3422,6 +3422,24 @@ class GeneralUtilityTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
 		);
 	}
 
+	/**
+	 * @test
+	 */
+	public function getFilesInDirCanOrderByMtime() {
+		$files = array();
+		$iterator = new \DirectoryIterator(__DIR__);
+		foreach ($iterator as $fileinfo) {
+			if ($fileinfo->isFile()) {
+				$files[$fileinfo->getFilename()] = $fileinfo->getMTime();
+			}
+		}
+		asort($files);
+		$this->assertSame(
+			array_values(Utility\GeneralUtility::getFilesInDir(__DIR__, '', FALSE, 'mtime')),
+			array_keys($files)
+		);
+	}
+
 	/**
 	 * @test
 	 */