diff --git a/lib/simpletestlib.php b/lib/simpletestlib.php
index <HASH>..<HASH> 100644
--- a/lib/simpletestlib.php
+++ b/lib/simpletestlib.php
@@ -37,7 +37,8 @@ function recurseFolders($path, $callback, $fileregexp = '/.*/', $exclude = false
 
     foreach ($files as $file) {
         $filepath = $path .'/'. $file;
-        if ($file == '.' || $file == '..') {
+        if (strpos($file, '.') === 0) {
+            /// Don't check hidden files.
             continue;
         } else if (is_dir($filepath)) {
             if (!in_array($filepath, $ignorefolders)) {
Unit tests: in recurseFolders, skip files/folders whose names begnis with '.'/