diff --git a/src/Composer/Package/Archiver/ArchivableFilesFinder.php b/src/Composer/Package/Archiver/ArchivableFilesFinder.php index 96459f872..b1045720d 100644 --- a/src/Composer/Package/Archiver/ArchivableFilesFinder.php +++ b/src/Composer/Package/Archiver/ArchivableFilesFinder.php @@ -84,7 +84,8 @@ class ArchivableFilesFinder extends \FilterIterator ->in($sources) ->filter($filter) ->ignoreVCS(true) - ->ignoreDotFiles(false); + ->ignoreDotFiles(false) + ->sortByName(true); parent::__construct($this->finder->getIterator()); } diff --git a/tests/Composer/Test/Package/Archiver/ArchivableFilesFinderTest.php b/tests/Composer/Test/Package/Archiver/ArchivableFilesFinderTest.php index 90db564fa..7392634a7 100644 --- a/tests/Composer/Test/Package/Archiver/ArchivableFilesFinderTest.php +++ b/tests/Composer/Test/Package/Archiver/ArchivableFilesFinderTest.php @@ -48,36 +48,36 @@ class ArchivableFilesFinderTest extends TestCase 'A/prefixD.foo', 'A/prefixE.foo', 'A/prefixF.foo', - 'B/sub/prefixA.foo', - 'B/sub/prefixB.foo', - 'B/sub/prefixC.foo', - 'B/sub/prefixD.foo', - 'B/sub/prefixE.foo', - 'B/sub/prefixF.foo', 'C/prefixA.foo', 'C/prefixB.foo', 'C/prefixC.foo', 'C/prefixD.foo', 'C/prefixE.foo', 'C/prefixF.foo', - 'D/prefixA', - 'D/prefixB', - 'D/prefixC', - 'D/prefixD', - 'D/prefixE', - 'D/prefixF', + 'B/sub/prefixA.foo', + 'B/sub/prefixB.foo', + 'B/sub/prefixC.foo', + 'B/sub/prefixD.foo', + 'B/sub/prefixE.foo', + 'B/sub/prefixF.foo', 'E/subtestA.foo', 'F/subtestA.foo', 'G/subtestA.foo', 'H/subtestA.foo', + 'D/prefixD', + 'D/prefixA', + 'D/prefixB', + 'D/prefixC', + 'D/prefixE', + 'D/prefixF', 'I/J/subtestA.foo', - 'K/dirJ/subtestA.foo', 'toplevelA.foo', 'toplevelB.foo', 'prefixA.foo', 'prefixB.foo', 'prefixC.foo', 'prefixD.foo', + 'K/dirJ/subtestA.foo', 'prefixE.foo', 'prefixF.foo', 'parameters.yml',