From 528030716e53dc09f102cd21827d7864675c7a81 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 13 Oct 2020 15:01:22 +0200 Subject: [PATCH] Fix tests --- .../Test/Repository/PathRepositoryTest.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/tests/Composer/Test/Repository/PathRepositoryTest.php b/tests/Composer/Test/Repository/PathRepositoryTest.php index 33235e11a..5833913e7 100644 --- a/tests/Composer/Test/Repository/PathRepositoryTest.php +++ b/tests/Composer/Test/Repository/PathRepositoryTest.php @@ -97,21 +97,16 @@ class PathRepositoryTest extends TestCase $repositoryUrl = implode(DIRECTORY_SEPARATOR, array(__DIR__, 'Fixtures', 'path', '*')); $repository = new PathRepository(array('url' => $repositoryUrl), $ioInterface, $config); $packages = $repository->getPackages(); - $names = array(); + $result = array(); $this->assertGreaterThanOrEqual(3, $repository->count()); - $package = $packages[0]; - $names[] = $package->getName(); + foreach ($packages as $package) { + $result[$package->getName()] = $package->getPrettyVersion(); + } - $package = $packages[count($packages) - 1]; - $names[] = $package->getName(); - - $package = $packages[2]; - $names[] = $package->getName(); - - sort($names); - $this->assertSame(array('test/path-branch-versioned', 'test/path-unversioned', 'test/path-versioned'), $names); + ksort($result); + $this->assertSame(array('test/path-branch-versioned' => '1.2.x-dev', 'test/path-unversioned' => $result['test/path-unversioned'], 'test/path-versioned' => '0.0.2'), $result); } /**