From dbcdb4a9038c08aefbc112cafb0f342b8f1312e1 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 15 Mar 2022 12:02:03 +0100 Subject: [PATCH] Add test for circular depths of equal weight --- tests/Composer/Test/Util/PackageSorterTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/Composer/Test/Util/PackageSorterTest.php b/tests/Composer/Test/Util/PackageSorterTest.php index b4c7e2b8a..5790ba04f 100644 --- a/tests/Composer/Test/Util/PackageSorterTest.php +++ b/tests/Composer/Test/Util/PackageSorterTest.php @@ -99,6 +99,20 @@ class PackageSorterTest extends TestCase 'foo/bar6', ), ), + 'circular deps sorted alphabetically if weighted equally' => array( + array( + $this->createPackage('foo/bar1', array('circular/part1')), + $this->createPackage('foo/bar2', array('circular/part2')), + $this->createPackage('circular/part1', array('circular/part2')), + $this->createPackage('circular/part2', array('circular/part1')), + ), + array( + 'circular/part1', + 'circular/part2', + 'foo/bar1', + 'foo/bar2', + ), + ), 'equal weight sorted alphabetically' => array( array( $this->createPackage('foo/bar10', array('foo/dep')),