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

View File

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

View File

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

View File

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