mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +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:
parent
dd8af946fd
commit
37d722e73c
141 changed files with 1342 additions and 1382 deletions
|
@ -118,10 +118,10 @@ JSON;
|
|||
$driver = new GitLabDriver(['url' => $url], $this->io, $this->config, $this->httpDownloader, $this->process);
|
||||
$driver->initialize();
|
||||
|
||||
$this->assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL');
|
||||
$this->assertEquals('mymaster', $driver->getRootIdentifier(), 'Root identifier is the default branch in GitLab');
|
||||
$this->assertEquals('git@gitlab.com:mygroup/myproject.git', $driver->getRepositoryUrl(), 'The repository URL is the SSH one by default');
|
||||
$this->assertEquals('https://gitlab.com/mygroup/myproject', $driver->getUrl());
|
||||
self::assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL');
|
||||
self::assertEquals('mymaster', $driver->getRootIdentifier(), 'Root identifier is the default branch in GitLab');
|
||||
self::assertEquals('git@gitlab.com:mygroup/myproject.git', $driver->getRepositoryUrl(), 'The repository URL is the SSH one by default');
|
||||
self::assertEquals('https://gitlab.com/mygroup/myproject', $driver->getUrl());
|
||||
|
||||
return $driver;
|
||||
}
|
||||
|
@ -158,10 +158,10 @@ JSON;
|
|||
$driver = new GitLabDriver(['url' => $url], $this->io, $this->config, $this->httpDownloader, $this->process);
|
||||
$driver->initialize();
|
||||
|
||||
$this->assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL');
|
||||
$this->assertEquals('mymaster', $driver->getRootIdentifier(), 'Root identifier is the default branch in GitLab');
|
||||
$this->assertEquals('https://gitlab.com/mygroup/myproject.git', $driver->getRepositoryUrl(), 'The repository URL is the SSH one by default');
|
||||
$this->assertEquals('https://gitlab.com/mygroup/myproject', $driver->getUrl());
|
||||
self::assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL');
|
||||
self::assertEquals('mymaster', $driver->getRootIdentifier(), 'Root identifier is the default branch in GitLab');
|
||||
self::assertEquals('https://gitlab.com/mygroup/myproject.git', $driver->getRepositoryUrl(), 'The repository URL is the SSH one by default');
|
||||
self::assertEquals('https://gitlab.com/mygroup/myproject', $driver->getUrl());
|
||||
|
||||
return $driver;
|
||||
}
|
||||
|
@ -197,10 +197,10 @@ JSON;
|
|||
$driver = new GitLabDriver(['url' => $url], $this->io, $this->config, $this->httpDownloader, $this->process);
|
||||
$driver->initialize();
|
||||
|
||||
$this->assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL');
|
||||
$this->assertEquals('mymaster', $driver->getRootIdentifier(), 'Root identifier is the default branch in GitLab');
|
||||
$this->assertEquals('https://gitlab.com/mygroup/myproject.git', $driver->getRepositoryUrl(), 'The repository URL is the SSH one by default');
|
||||
$this->assertEquals('https://gitlab.com/mygroup/myproject', $driver->getUrl());
|
||||
self::assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL');
|
||||
self::assertEquals('mymaster', $driver->getRootIdentifier(), 'Root identifier is the default branch in GitLab');
|
||||
self::assertEquals('https://gitlab.com/mygroup/myproject.git', $driver->getRepositoryUrl(), 'The repository URL is the SSH one by default');
|
||||
self::assertEquals('https://gitlab.com/mygroup/myproject', $driver->getUrl());
|
||||
|
||||
return $driver;
|
||||
}
|
||||
|
@ -238,10 +238,10 @@ JSON;
|
|||
$driver = new GitLabDriver(['url' => $url], $this->io, $this->config, $this->httpDownloader, $this->process);
|
||||
$driver->initialize();
|
||||
|
||||
$this->assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL');
|
||||
$this->assertEquals('1.0.x', $driver->getRootIdentifier(), 'Root identifier is the default branch in GitLab');
|
||||
$this->assertEquals($url.'.git', $driver->getRepositoryUrl(), 'The repository URL is the SSH one by default');
|
||||
$this->assertEquals($url, $driver->getUrl());
|
||||
self::assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL');
|
||||
self::assertEquals('1.0.x', $driver->getRootIdentifier(), 'Root identifier is the default branch in GitLab');
|
||||
self::assertEquals($url.'.git', $driver->getRepositoryUrl(), 'The repository URL is the SSH one by default');
|
||||
self::assertEquals($url, $driver->getUrl());
|
||||
}
|
||||
|
||||
public function testInvalidSupportData(): void
|
||||
|
@ -256,8 +256,8 @@ JSON;
|
|||
|
||||
$data = $driver->getComposerInformation('main');
|
||||
|
||||
$this->assertIsArray($data);
|
||||
$this->assertSame('https://gitlab.com/mygroup/myproject/-/tree/main', $data['support']['source']);
|
||||
self::assertIsArray($data);
|
||||
self::assertSame('https://gitlab.com/mygroup/myproject/-/tree/main', $data['support']['source']);
|
||||
}
|
||||
|
||||
public function testGetDist(): void
|
||||
|
@ -272,7 +272,7 @@ JSON;
|
|||
'shasum' => '',
|
||||
];
|
||||
|
||||
$this->assertEquals($expected, $driver->getDist($reference));
|
||||
self::assertEquals($expected, $driver->getDist($reference));
|
||||
}
|
||||
|
||||
public function testGetSource(): void
|
||||
|
@ -286,7 +286,7 @@ JSON;
|
|||
'reference' => $reference,
|
||||
];
|
||||
|
||||
$this->assertEquals($expected, $driver->getSource($reference));
|
||||
self::assertEquals($expected, $driver->getSource($reference));
|
||||
}
|
||||
|
||||
public function testGetSource_GivenPublicProject(): void
|
||||
|
@ -300,7 +300,7 @@ JSON;
|
|||
'reference' => $reference,
|
||||
];
|
||||
|
||||
$this->assertEquals($expected, $driver->getSource($reference));
|
||||
self::assertEquals($expected, $driver->getSource($reference));
|
||||
}
|
||||
|
||||
public function testGetTags(): void
|
||||
|
@ -340,8 +340,8 @@ JSON;
|
|||
'v2.0.0' => '8e8f60b3ec86d63733db3bd6371117a758027ec6',
|
||||
];
|
||||
|
||||
$this->assertEquals($expected, $driver->getTags());
|
||||
$this->assertEquals($expected, $driver->getTags(), 'Tags are cached');
|
||||
self::assertEquals($expected, $driver->getTags());
|
||||
self::assertEquals($expected, $driver->getTags(), 'Tags are cached');
|
||||
}
|
||||
|
||||
public function testGetPaginatedRefs(): void
|
||||
|
@ -402,8 +402,8 @@ JSON;
|
|||
'stagingdupe' => '502cffe49f136443f2059803f2e7192d1ac066cd',
|
||||
];
|
||||
|
||||
$this->assertEquals($expected, $driver->getBranches());
|
||||
$this->assertEquals($expected, $driver->getBranches(), 'Branches are cached');
|
||||
self::assertEquals($expected, $driver->getBranches());
|
||||
self::assertEquals($expected, $driver->getBranches(), 'Branches are cached');
|
||||
}
|
||||
|
||||
public function testGetBranches(): void
|
||||
|
@ -444,8 +444,8 @@ JSON;
|
|||
'staging' => '502cffe49f136443f2059803f2e7192d1ac066cd',
|
||||
];
|
||||
|
||||
$this->assertEquals($expected, $driver->getBranches());
|
||||
$this->assertEquals($expected, $driver->getBranches(), 'Branches are cached');
|
||||
self::assertEquals($expected, $driver->getBranches());
|
||||
self::assertEquals($expected, $driver->getBranches(), 'Branches are cached');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -454,7 +454,7 @@ JSON;
|
|||
*/
|
||||
public function testSupports(string $url, bool $expected): void
|
||||
{
|
||||
$this->assertSame($expected, GitLabDriver::supports($this->io, $this->config, $url));
|
||||
self::assertSame($expected, GitLabDriver::supports($this->io, $this->config, $url));
|
||||
}
|
||||
|
||||
public static function dataForTestSupports(): array
|
||||
|
@ -510,7 +510,7 @@ JSON;
|
|||
$driver = new GitLabDriver(['url' => $url], $this->io, $this->config, $this->httpDownloader, $this->process);
|
||||
$driver->initialize();
|
||||
|
||||
$this->assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL');
|
||||
self::assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL');
|
||||
}
|
||||
|
||||
public function testGitlabSubGroup(): void
|
||||
|
@ -542,7 +542,7 @@ JSON;
|
|||
$driver = new GitLabDriver(['url' => $url], $this->io, $this->config, $this->httpDownloader, $this->process);
|
||||
$driver->initialize();
|
||||
|
||||
$this->assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL');
|
||||
self::assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL');
|
||||
}
|
||||
|
||||
public function testGitlabSubDirectorySubGroup(): void
|
||||
|
@ -574,7 +574,7 @@ JSON;
|
|||
$driver = new GitLabDriver(['url' => $url], $this->io, $this->config, $this->httpDownloader, $this->process);
|
||||
$driver->initialize();
|
||||
|
||||
$this->assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL');
|
||||
self::assertEquals($apiUrl, $driver->getApiUrl(), 'API URL is derived from the repository URL');
|
||||
}
|
||||
|
||||
public function testForwardsOptions(): void
|
||||
|
@ -645,7 +645,7 @@ JSON;
|
|||
$config->merge(['config' => ['gitlab-protocol' => 'http']]);
|
||||
$driver = new GitLabDriver(['url' => $url], $this->io, $config, $this->httpDownloader, $this->process);
|
||||
$driver->initialize();
|
||||
$this->assertEquals('https://gitlab.com/mygroup/myproject.git', $driver->getRepositoryUrl(), 'Repository URL matches config request for http not git');
|
||||
self::assertEquals('https://gitlab.com/mygroup/myproject.git', $driver->getRepositoryUrl(), 'Repository URL matches config request for http not git');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue