1
0
Fork 0

phpstan: update tests/Composer/Test/Installer/* to level 6 standard (#10225)

pull/10227/head
megubyte 2021-10-27 13:41:30 +01:00 committed by GitHub
parent 3ccb54832b
commit c2a2198089
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 71 additions and 0 deletions

View File

@ -21,8 +21,19 @@ use Composer\Test\TestCase;
class InstallationManagerTest extends TestCase
{
/**
* @var \Composer\Repository\InstalledRepositoryInterface&\PHPUnit\Framework\MockObject\MockObject
*/
protected $repository;
/**
* @var \Composer\Util\Loop&\PHPUnit\Framework\MockObject\MockObject
*/
protected $loop;
/**
* @var \Composer\IO\IOInterface&\PHPUnit\Framework\MockObject\MockObject
*/
protected $io;
public function setUp()
@ -282,12 +293,18 @@ class InstallationManagerTest extends TestCase
$manager->ensureBinariesPresence($package);
}
/**
* @return \Composer\Installer\InstallerInterface&\PHPUnit\Framework\MockObject\MockObject
*/
private function createInstallerMock()
{
return $this->getMockBuilder('Composer\Installer\InstallerInterface')
->getMock();
}
/**
* @return \Composer\Package\PackageInterface&\PHPUnit\Framework\MockObject\MockObject
*/
private function createPackageMock()
{
$mock = $this->getMockBuilder('Composer\Package\PackageInterface')

View File

@ -20,14 +20,49 @@ use Composer\Config;
class LibraryInstallerTest extends TestCase
{
/**
* @var \Composer\Composer
*/
protected $composer;
/**
* @var \Composer\Config
*/
protected $config;
/**
* @var string
*/
protected $rootDir;
/**
* @var string
*/
protected $vendorDir;
/**
* @var string
*/
protected $binDir;
/**
* @var \Composer\Downloader\DownloadManager&\PHPUnit\Framework\MockObject\MockObject
*/
protected $dm;
/**
* @var \Composer\Repository\InstalledRepositoryInterface&\PHPUnit\Framework\MockObject\MockObject
*/
protected $repository;
/**
* @var \Composer\IO\IOInterface&\PHPUnit\Framework\MockObject\MockObject
*/
protected $io;
/**
* @var \Composer\Util\Filesystem
*/
protected $fs;
protected function setUp()
@ -285,6 +320,9 @@ class LibraryInstallerTest extends TestCase
$library->ensureBinariesPresence($package);
}
/**
* @return \Composer\Package\PackageInterface&\PHPUnit\Framework\MockObject\MockObject
*/
protected function createPackageMock()
{
return $this->getMockBuilder('Composer\Package\Package')

View File

@ -107,6 +107,9 @@ class MetapackageInstallerTest extends TestCase
$this->installer->uninstall($this->repository, $package);
}
/**
* @return \Composer\Package\PackageInterface&\PHPUnit\Framework\MockObject\MockObject
*/
private function createPackageMock()
{
return $this->getMockBuilder('Composer\Package\Package')

View File

@ -20,7 +20,14 @@ use Composer\Test\TestCase;
*/
class SuggestedPackagesReporterTest extends TestCase
{
/**
* @var \PHPUnit\Framework\MockObject\MockObject
*/
private $io;
/**
* @var \Composer\Installer\SuggestedPackagesReporter
*/
private $suggestedPackagesReporter;
protected function setUp()
@ -267,6 +274,9 @@ class SuggestedPackagesReporterTest extends TestCase
$this->suggestedPackagesReporter->output(SuggestedPackagesReporter::MODE_BY_PACKAGE, $repository);
}
/**
* @return array<string, string>
*/
private function getSuggestedPackageArray()
{
return array(
@ -276,6 +286,9 @@ class SuggestedPackagesReporterTest extends TestCase
);
}
/**
* @return \Composer\Package\PackageInterface&\PHPUnit\Framework\MockObject\MockObject
*/
private function createPackageMock()
{
return $this->getMockBuilder('Composer\Package\Package')