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

@ -54,7 +54,7 @@ class LicensesCommandTest extends TestCase
public function testBasicRun(): void
{
$appTester = $this->getApplicationTester();
$this->assertSame(0, $appTester->run(['command' => 'license']));
self::assertSame(0, $appTester->run(['command' => 'license']));
$expected = [
["Name:", "test/pkg"],
@ -81,14 +81,14 @@ class LicensesCommandTest extends TestCase
if (!isset($expected[$i])) {
$this->fail('Got more output lines than expected');
}
$this->assertMatchesRegularExpression("/" . implode("\s+", $expected[$i]) . "/", $line);
self::assertMatchesRegularExpression("/" . implode("\s+", $expected[$i]) . "/", $line);
}
}
public function testNoDev(): void
{
$appTester = $this->getApplicationTester();
$this->assertSame(0, $appTester->run(['command' => 'license', '--no-dev' => true]));
self::assertSame(0, $appTester->run(['command' => 'license', '--no-dev' => true]));
$expected = [
["Name:", "test/pkg"],
@ -114,14 +114,14 @@ class LicensesCommandTest extends TestCase
if (!isset($expected[$i])) {
$this->fail('Got more output lines than expected');
}
$this->assertMatchesRegularExpression("/" . implode("\s+", $expected[$i]) . "/", $line);
self::assertMatchesRegularExpression("/" . implode("\s+", $expected[$i]) . "/", $line);
}
}
public function testFormatJson(): void
{
$appTester = $this->getApplicationTester();
$this->assertSame(0, $appTester->run(['command' => 'license', '--format' => 'json'], ['capture_stderr_separately' => true]));
self::assertSame(0, $appTester->run(['command' => 'license', '--format' => 'json'], ['capture_stderr_separately' => true]));
$expected = [
"name" => "test/pkg",
@ -153,13 +153,13 @@ class LicensesCommandTest extends TestCase
]
];
$this->assertSame($expected, json_decode($appTester->getDisplay(), true));
self::assertSame($expected, json_decode($appTester->getDisplay(), true));
}
public function testFormatSummary(): void
{
$appTester = $this->getApplicationTester();
$this->assertSame(0, $appTester->run(['command' => 'license', '--format' => 'summary']));
self::assertSame(0, $appTester->run(['command' => 'license', '--format' => 'summary']));
$expected = [
['-', '-'],
@ -176,7 +176,7 @@ class LicensesCommandTest extends TestCase
foreach ($expected as $i => $expect) {
[$key, $value] = $expect;
$this->assertMatchesRegularExpression("/$key\s+$value/", $lines[$i]);
self::assertMatchesRegularExpression("/$key\s+$value/", $lines[$i]);
}
}