@@ -36,14 +36,12 @@ protected function buildIterator($dir)
3636    {
3737        $ dirrtrim ($ dir'\\/ ' );
3838
39-         $ iterator  =  new  \RecursiveIteratorIterator (
39+         return  new  \RecursiveIteratorIterator (
4040            new  \RecursiveDirectoryIterator (
4141                $ dir
4242                \RecursiveDirectoryIterator::SKIP_DOTS  | \RecursiveDirectoryIterator::UNIX_PATHS 
4343            )
4444        );
45- 
46-         return  $ iterator
4745    }
4846
4947    /** 
@@ -105,6 +103,8 @@ protected function assertData($data)
105103            return  '/ '  . ltrim (str_replace ($ root'' , $ filegetPathname ()), '/ ' );
106104        }, iterator_to_array ($ currentIteratorfalse ));
107105
106+         usort ($ currentFiles'strcasecmp ' );
107+ 
108108        $ this prettyAssert (
109109            $ snapshotFiles
110110            $ currentFiles
@@ -113,7 +113,15 @@ protected function assertData($data)
113113
114114        $ multiIteratornew  \MultipleIterator ();
115115        $ multiIteratorattachIterator (new  \ArrayIterator ($ snapshotFiles
116-         $ multiIteratorattachIterator ($ currentIterator
116+         $ sortedFilesiterator_to_array ($ currentIterator
117+         $ sortedFilesarray_combine (
118+             array_map (static  function  (\SplFileInfo   $ f
119+                 return  $ fgetPathname ();
120+             }, $ sortedFiles
121+             $ sortedFiles
122+         );
123+         uksort ($ sortedFiles'strcasecmp ' );
124+         $ multiIteratorattachIterator (new  \ArrayIterator ($ sortedFiles
117125
118126        /** @var \SplFileInfo $file */ 
119127        foreach  ($ multiIteratoras  list ($ fileRelativePath$ file
@@ -163,6 +171,8 @@ protected function readFileListFromSnapshot($snapshotFilePath)
163171            throw  new  \RuntimeException ("Could not close snapshot file [ {$ snapshotFilePath]. " );
164172        }
165173
174+         usort ($ filePaths'strcasecmp ' );
175+ 
166176        return  $ filePaths
167177    }
168178
0 commit comments