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

Add types to Repository tests (#10227)

This commit is contained in:
Martin Herndl 2021-10-27 15:29:52 +02:00 committed by GitHub
parent 3d9e9ba66f
commit d51c7685da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 133 additions and 23 deletions

View file

@ -85,6 +85,9 @@ class PerforceDriverTest extends TestCase
$fs->removeDirectory($this->testPath);
}
/**
* @return void
*/
protected function overrideDriverInternalPerforce(Perforce $perforce)
{
$reflectionClass = new \ReflectionClass($this->driver);
@ -93,6 +96,11 @@ class PerforceDriverTest extends TestCase
$property->setValue($this->driver, $perforce);
}
/**
* @param string $testPath
*
* @return Config
*/
protected function getTestConfig($testPath)
{
$config = new Config();
@ -101,16 +109,25 @@ class PerforceDriverTest extends TestCase
return $config;
}
/**
* @return \PHPUnit\Framework\MockObject\MockObject&\Composer\IO\IOInterface
*/
protected function getMockIOInterface()
{
return $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
}
/**
* @return \PHPUnit\Framework\MockObject\MockObject&\Composer\Util\HttpDownloader
*/
protected function getMockHttpDownloader()
{
return $this->getMockBuilder('Composer\Util\HttpDownloader')->disableOriginalConstructor()->getMock();
}
/**
* @return \PHPUnit\Framework\MockObject\MockObject&\Composer\Util\Perforce
*/
protected function getMockPerforce()
{
$methods = array('p4login', 'checkStream', 'writeP4ClientSpec', 'connectClient', 'getComposerInformation', 'cleanupClientSpec');