1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Add types to Util tests (#10228)

This commit is contained in:
Martin Herndl 2021-10-27 16:18:46 +02:00 committed by GitHub
parent d51c7685da
commit 2992e8651a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 268 additions and 49 deletions

View file

@ -22,10 +22,15 @@ use Composer\Test\TestCase;
*/
class GitLabTest extends TestCase
{
/** @var string */
private $username = 'username';
/** @var string */
private $password = 'password';
/** @var string */
private $message = 'mymessage';
/** @var string */
private $origin = 'gitlab.com';
/** @var string */
private $token = 'gitlabtoken';
public function testUsernamePasswordAuthenticationFlow()
@ -109,6 +114,9 @@ class GitLabTest extends TestCase
$gitLab->authorizeOAuthInteractively('https', $this->origin);
}
/**
* @return \PHPUnit\Framework\MockObject\MockObject&\Composer\IO\ConsoleIO
*/
private function getIOMock()
{
$io = $this
@ -120,11 +128,17 @@ class GitLabTest extends TestCase
return $io;
}
/**
* @return \PHPUnit\Framework\MockObject\MockObject&\Composer\Config
*/
private function getConfigMock()
{
return $this->getMockBuilder('Composer\Config')->getMock();
}
/**
* @return \PHPUnit\Framework\MockObject\MockObject&\Composer\Util\HttpDownloader
*/
private function getHttpDownloaderMock()
{
$httpDownloader = $this
@ -136,6 +150,9 @@ class GitLabTest extends TestCase
return $httpDownloader;
}
/**
* @return \PHPUnit\Framework\MockObject\MockObject&\Composer\Config\JsonConfigSource
*/
private function getAuthJsonMock()
{
$authjson = $this