Fix self-update tests on releases
parent
2124f09d75
commit
94fe294545
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
namespace Composer\Test\Command;
|
namespace Composer\Test\Command;
|
||||||
|
|
||||||
|
use Composer\Composer;
|
||||||
use Composer\Test\TestCase;
|
use Composer\Test\TestCase;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,6 +45,10 @@ class SelfUpdateCommandTest extends TestCase
|
||||||
|
|
||||||
public function testSuccessfulUpdate(): void
|
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 = $this->getApplicationTester();
|
||||||
$appTester->run(['command' => 'self-update']);
|
$appTester->run(['command' => 'self-update']);
|
||||||
|
|
||||||
|
@ -74,6 +79,10 @@ class SelfUpdateCommandTest extends TestCase
|
||||||
*/
|
*/
|
||||||
public function testUpdateToDifferentChannel(string $option, string $expectedOutput): void
|
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 = $this->getApplicationTester();
|
||||||
$appTester->run(['command' => 'self-update', $option => true]);
|
$appTester->run(['command' => 'self-update', $option => true]);
|
||||||
$appTester->assertCommandIsSuccessful();
|
$appTester->assertCommandIsSuccessful();
|
||||||
|
|
Loading…
Reference in New Issue