Skip to content

Commit

Permalink
Fix test for old composer
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkov committed Aug 21, 2024
1 parent 3370c90 commit f54fbe9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Composer\Composer;
use Composer\IO\NullIO;
use Composer\Package\RootPackageInterface;
use Composer\PartialComposer;
use Composer\Plugin\PluginManager;
use PHPUnit\Framework\ExpectationFailedException;
use PHPUnit\Framework\TestCase;
Expand Down Expand Up @@ -440,7 +439,10 @@ private function createComposerMock()
});

$pluginManager = $this->createMock(PluginManager::class);
$globalComposer = $this->createMock(PartialComposer::class);
// PartialComposer is returned for 2.3.0+ composer
$globalComposer = class_exists('Composer\PartialComposer')
? $this->createMock('Composer\PartialComposer')
: $this->createMock('Composer\Composer');
$globalPackageInterface = $this->createMock(RootPackageInterface::class);

$composer->method('getPluginManager')->willReturn($pluginManager);
Expand Down

0 comments on commit f54fbe9

Please sign in to comment.