diff --git a/tests/Composer/Test/Command/SelfUpdateCommandTest.php b/tests/Composer/Test/Command/SelfUpdateCommandTest.php index d0b855563..cc7b579ff 100644 --- a/tests/Composer/Test/Command/SelfUpdateCommandTest.php +++ b/tests/Composer/Test/Command/SelfUpdateCommandTest.php @@ -12,6 +12,7 @@ namespace Composer\Test\Command; +use Composer\Composer; use Composer\Test\TestCase; /** @@ -44,6 +45,10 @@ class SelfUpdateCommandTest extends TestCase public function testSuccessfulUpdate(): void { + if (Composer::VERSION !== '@package_version'.'@') { + $this->markTestSkipped('On releases this test can fail to upgrade as we are already on latest version'); + } + $appTester = $this->getApplicationTester(); $appTester->run(['command' => 'self-update']); @@ -74,6 +79,10 @@ class SelfUpdateCommandTest extends TestCase */ public function testUpdateToDifferentChannel(string $option, string $expectedOutput): void { + if (Composer::VERSION !== '@package_version'.'@' && in_array($option, ['--stable', '--preview'], true)) { + $this->markTestSkipped('On releases this test can fail to upgrade as we are already on latest version'); + } + $appTester = $this->getApplicationTester(); $appTester->run(['command' => 'self-update', $option => true]); $appTester->assertCommandIsSuccessful();