mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Tweak and fix some more phpstan reports
This commit is contained in:
parent
a062cd1a31
commit
799717f102
5 changed files with 17 additions and 12 deletions
|
@ -32,17 +32,18 @@ class VcsRepositoryTest extends TestCase
|
|||
|
||||
protected function initialize()
|
||||
{
|
||||
$oldCwd = getcwd();
|
||||
self::$composerHome = $this->getUniqueTmpDirectory();
|
||||
self::$gitRepo = $this->getUniqueTmpDirectory();
|
||||
|
||||
$locator = new ExecutableFinder();
|
||||
if (!$locator->find('git')) {
|
||||
$this->skipped = 'This test needs a git binary in the PATH to be able to run';
|
||||
|
||||
return;
|
||||
}
|
||||
if (!@mkdir(self::$gitRepo) || !@chdir(self::$gitRepo)) {
|
||||
|
||||
$oldCwd = getcwd();
|
||||
self::$composerHome = $this->getUniqueTmpDirectory();
|
||||
self::$gitRepo = $this->getUniqueTmpDirectory();
|
||||
|
||||
if (!@chdir(self::$gitRepo)) {
|
||||
$this->skipped = 'Could not create and move into the temp git repo '.self::$gitRepo;
|
||||
|
||||
return;
|
||||
|
@ -60,6 +61,7 @@ class VcsRepositoryTest extends TestCase
|
|||
$exec('git init');
|
||||
$exec('git config user.email composertest@example.org');
|
||||
$exec('git config user.name ComposerTest');
|
||||
$exec('git config commit.gpgsign false');
|
||||
touch('foo');
|
||||
$exec('git add foo');
|
||||
$exec('git commit -m init');
|
||||
|
@ -150,7 +152,8 @@ class VcsRepositoryTest extends TestCase
|
|||
'home' => self::$composerHome,
|
||||
),
|
||||
));
|
||||
$repo = new VcsRepository(array('url' => self::$gitRepo, 'type' => 'vcs'), new NullIO, $config);
|
||||
$httpDownloader = $this->getMockBuilder('Composer\Util\HttpDownloader')->disableOriginalConstructor()->getMock();
|
||||
$repo = new VcsRepository(array('url' => self::$gitRepo, 'type' => 'vcs'), new NullIO, $config, $httpDownloader);
|
||||
$packages = $repo->getPackages();
|
||||
$dumper = new ArrayDumper();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue