1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-11 01:22:54 +00:00

PHPStan/tests updates (#11996)

* Remove a bunch of inline ignores and migrate all PHPUnit assertions to static calls

* Update baseline (1573, 93)

* Update commit hash
This commit is contained in:
Jordi Boggiano 2024-05-29 23:12:06 +02:00 committed by GitHub
parent dd8af946fd
commit 37d722e73c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
141 changed files with 1342 additions and 1382 deletions

View file

@ -28,7 +28,7 @@ class RemoveCommandTest extends TestCase
$this->expectExceptionMessage('Not enough arguments (missing: "packages").');
$appTester = $this->getApplicationTester();
$this->assertEquals(Command::FAILURE, $appTester->run(['command' => 'remove']));
self::assertEquals(Command::FAILURE, $appTester->run(['command' => 'remove']));
}
public function testExceptionWhenRunningUnusedWithoutLockFile(): void
@ -39,7 +39,7 @@ class RemoveCommandTest extends TestCase
$this->expectExceptionMessage('A valid composer.lock file is required to run this command with --unused');
$appTester = $this->getApplicationTester();
$this->assertEquals(Command::FAILURE, $appTester->run(['command' => 'remove', '--unused' => true]));
self::assertEquals(Command::FAILURE, $appTester->run(['command' => 'remove', '--unused' => true]));
}
public function testWarningWhenRemovingNonExistentPackage(): void
@ -64,7 +64,7 @@ class RemoveCommandTest extends TestCase
self::assertEquals(Command::SUCCESS, $appTester->run(['command' => 'remove', 'packages' => ['root/req'], '--dev' => true, '--no-update' => true, '--no-interaction' => true]));
self::assertSame('<warning>root/req could not be found in require-dev but it is present in require</warning>
./composer.json has been updated', trim($appTester->getDisplay(true)));
$this->assertEquals(['require' => ['root/req' => '1.*']], (new JsonFile('./composer.json'))->read());
self::assertEquals(['require' => ['root/req' => '1.*']], (new JsonFile('./composer.json'))->read());
}
public function testWarningWhenRemovingPackageWithDeprecatedDependenciesFlag(): void
@ -79,7 +79,7 @@ class RemoveCommandTest extends TestCase
self::assertEquals(Command::SUCCESS, $appTester->run(['command' => 'remove', 'packages' => ['root/req'], '--update-with-dependencies' => true, '--no-update' => true, '--no-interaction' => true]));
self::assertSame('<warning>You are using the deprecated option "update-with-dependencies". This is now default behaviour. The --no-update-with-dependencies option can be used to remove a package without its dependencies.</warning>
./composer.json has been updated', trim($appTester->getDisplay(true)));
$this->assertEmpty((new JsonFile('./composer.json'))->read());
self::assertEmpty((new JsonFile('./composer.json'))->read());
}
public function testMessageOutputWhenNoUnusedPackagesToRemove(): void