main
Jordi Boggiano 2 years ago
parent 2e40cdf2dc
commit 86fb8d4412
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC

@ -20,11 +20,9 @@ use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory;
use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterInterface;
use Composer\IO\IOInterface;
use Composer\IO\NullIO;
use Composer\Pcre\Preg;
use Composer\Plugin\PreCommandRunEvent;
use Composer\Package\Version\VersionParser;
use Composer\Plugin\PluginEvents;
use Composer\Repository\PlatformRepository;
use Composer\Util\Platform;
use Symfony\Component\Console\Helper\Table;
use Symfony\Component\Console\Helper\TableSeparator;

@ -455,7 +455,7 @@ EOT
return 'php-only';
}
return $val !== 'false' && (bool)$val;
return $val !== 'false' && (bool) $val;
},
),
'use-parent-dir' => array(
@ -739,7 +739,7 @@ EOT
return 0;
}
$this->configSource->addConfigSetting($settingKey, $values[0] === 'false' ? false : $values[0]);
$this->configSource->addConfigSetting($settingKey, $values[0] === 'false' ? false : $values[0]);
return 0;
}

@ -12,7 +12,6 @@
namespace Composer\Command;
use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory;
use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents;
use Symfony\Component\Console\Input\InputInterface;

@ -13,24 +13,15 @@
namespace Composer\Command;
use Composer\Factory;
use Composer\Filter\PlatformRequirementFilter\IgnoreAllPlatformRequirementFilter;
use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory;
use Composer\Json\JsonFile;
use Composer\Json\JsonValidationException;
use Composer\Package\BasePackage;
use Composer\Package\CompletePackageInterface;
use Composer\Package\Package;
use Composer\Package\PackageInterface;
use Composer\Package\Version\VersionParser;
use Composer\Package\Version\VersionSelector;
use Composer\Pcre\Preg;
use Composer\Repository\CompositeRepository;
use Composer\Repository\PlatformRepository;
use Composer\Repository\RepositoryFactory;
use Composer\Repository\RepositorySet;
use Composer\Util\Filesystem;
use Composer\Util\ProcessExecutor;
use Composer\Semver\Constraint\Constraint;
use Composer\Util\Silencer;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputInterface;

@ -12,7 +12,6 @@
namespace Composer\Command;
use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory;
use Composer\Installer;
use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents;

@ -1,5 +1,15 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Command;
use Composer\Factory;

@ -15,7 +15,6 @@ namespace Composer\Command;
use Composer\DependencyResolver\Operation\InstallOperation;
use Composer\DependencyResolver\Operation\UninstallOperation;
use Composer\DependencyResolver\Transaction;
use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory;
use Composer\Package\AliasPackage;
use Composer\Package\BasePackage;
use Composer\Pcre\Preg;

@ -14,7 +14,6 @@ namespace Composer\Command;
use Composer\Config\JsonConfigSource;
use Composer\DependencyResolver\Request;
use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory;
use Composer\Installer;
use Composer\Pcre\Preg;
use Composer\Plugin\CommandEvent;

@ -13,8 +13,6 @@
namespace Composer\Command;
use Composer\DependencyResolver\Request;
use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory;
use Composer\Repository\RepositorySet;
use Composer\Util\Filesystem;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;

@ -14,7 +14,6 @@ namespace Composer\Command;
use Composer\Composer;
use Composer\DependencyResolver\DefaultPolicy;
use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory;
use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterInterface;
use Composer\Json\JsonFile;
use Composer\Package\BasePackage;

@ -14,7 +14,6 @@ namespace Composer\Command;
use Composer\Composer;
use Composer\DependencyResolver\Request;
use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory;
use Composer\Installer;
use Composer\IO\IOInterface;
use Composer\Package\Loader\RootPackageLoader;

@ -50,12 +50,13 @@ final class GithubActionError
}
}
}
/**
* @param string $data
* @return string
*/
private function escapeData($data) {
private function escapeData($data)
{
// see https://github.com/actions/toolkit/blob/4f7fb6513a355689f69f0849edeb369a4dc81729/packages/core/src/command.ts#L80-L85
$data = str_replace("%", '%25', $data);
$data = str_replace("\r", '%0D', $data);
@ -63,12 +64,13 @@ final class GithubActionError
return $data;
}
/**
* @param string $property
* @return string
*/
private function escapeProperty($property) {
private function escapeProperty($property)
{
// see https://github.com/actions/toolkit/blob/4f7fb6513a355689f69f0849edeb369a4dc81729/packages/core/src/command.ts#L87-L94
$property = str_replace("%", '%25', $property);
$property = str_replace("\r", '%0D', $property);

@ -704,7 +704,7 @@ class PoolBuilder
'<info>Found %s package versions referenced in your dependency graph. %s (%d%%) were optimized away.</info>',
number_format($total),
number_format($filtered),
round(100/$total*$filtered)
round(100 / $total * $filtered)
), true, IOInterface::VERY_VERBOSE);
return $pool;

@ -211,7 +211,6 @@ class PoolOptimizer
$dependencyHash = $this->calculateDependencyHash($package);
foreach ($package->getNames(false) as $packageName) {
if (!isset($this->requireConstraintsPerPackage[$packageName])) {
continue;
}
@ -287,7 +286,7 @@ class PoolOptimizer
'requires' => $package->getRequires(),
'conflicts' => $package->getConflicts(),
'replaces' => $package->getReplaces(),
'provides' => $package->getProvides()
'provides' => $package->getProvides(),
);
foreach ($hashRelevantLinks as $key => $links) {

@ -261,7 +261,6 @@ abstract class Rule
}
}
/**
* @param bool $isVerbose
* @param BasePackage[] $installedMap

@ -17,7 +17,6 @@ use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory;
use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterInterface;
use Composer\Package\BasePackage;
use Composer\Package\AliasPackage;
use Composer\Repository\PlatformRepository;
/**
* @author Nils Adermann <naderman@naderman.de>

@ -1,5 +1,15 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Filter\PlatformRequirementFilter;
use Composer\Repository\PlatformRepository;

@ -1,5 +1,15 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Filter\PlatformRequirementFilter;
use Composer\Package\BasePackage;

@ -1,5 +1,15 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Filter\PlatformRequirementFilter;
final class IgnoreNothingPlatformRequirementFilter implements PlatformRequirementFilterInterface

@ -1,5 +1,15 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Filter\PlatformRequirementFilter;
final class PlatformRequirementFilterFactory

@ -1,5 +1,15 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Filter\PlatformRequirementFilter;
interface PlatformRequirementFilterInterface

@ -167,6 +167,7 @@ class PluginManager
if (!$this->isPluginAllowed($package->getName(), $isGlobalPlugin)) {
$this->io->writeError('Skipped loading "'.$package->getName() . '" '.($isGlobalPlugin ? '(installed globally) ' : '').'as it is not in config.allow-plugins', true, IOInterface::DEBUG);
return;
}
@ -397,6 +398,7 @@ class PluginManager
trigger_error('Calling PluginManager::addPlugin without $sourcePackage is deprecated, if you are using this please get in touch with us to explain the use case', E_USER_DEPRECATED);
} elseif (!$this->isPluginAllowed($sourcePackage->getName(), $isGlobalPlugin)) {
$this->io->writeError('Skipped loading "'.get_class($plugin).' from '.$sourcePackage->getName() . '" '.($isGlobalPlugin ? '(installed globally) ' : '').' as it is not in config.allow-plugins', true, IOInterface::DEBUG);
return;
}
@ -735,7 +737,7 @@ class PluginManager
'y - add package to allow-plugins in composer.json and let it run immediately',
'n - add package (as disallowed) to allow-plugins in composer.json to suppress further prompts',
'd - discard this, do not change composer.json and do not allow the plugin to run',
'? - print help'
'? - print help',
));
break;
}

@ -321,6 +321,7 @@ class ComposerRepository extends ArrayRepository implements ConfigurableReposito
if (!is_array($this->partialPackagesByName)) {
throw new \LogicException('hasPartialPackages failed to initialize $this->partialPackagesByName');
}
return $this->createPackages($this->partialPackagesByName, 'packages.json inline packages');
}

@ -91,7 +91,7 @@ class PlatformRepository extends ArrayRepository
/**
* @param string $name
* @return boolean
* @return bool
*/
public function isPlatformPackageDisabled($name)
{
@ -541,6 +541,7 @@ class PlatformRepository extends ArrayRepository
if (isset($this->overrides[$package->getName()])) {
if ($this->overrides[$package->getName()]['version'] === false) {
$this->addDisabledPackage($package);
return;
}
@ -561,6 +562,7 @@ class PlatformRepository extends ArrayRepository
if (isset($this->overrides['php']) && 0 === strpos($package->getName(), 'php-')) {
if (isset($this->overrides[$package->getName()]) && $this->overrides[$package->getName()]['version'] === false) {
$this->addDisabledPackage($package);
return;
}

@ -13,7 +13,6 @@
namespace Composer\Repository;
use Composer\DependencyResolver\PoolOptimizer;
use Composer\DependencyResolver\PolicyInterface;
use Composer\DependencyResolver\Pool;
use Composer\DependencyResolver\PoolBuilder;
use Composer\DependencyResolver\Request;

@ -13,7 +13,6 @@
namespace Composer\Util;
use Composer\IO\IOInterface;
use Composer\Pcre\Preg;
/**
* Convert PHP errors into exceptions

@ -16,7 +16,6 @@ use Composer\Config;
use Composer\Downloader\MaxFileSizeExceededException;
use Composer\IO\IOInterface;
use Composer\Downloader\TransportException;
use Composer\CaBundle\CaBundle;
use Composer\Pcre\Preg;
use Composer\Util\Http\Response;
use Composer\Util\Http\ProxyManager;

@ -15,7 +15,6 @@ namespace Composer\Test;
use Composer\Console\Application;
use Composer\XdebugHandler\XdebugHandler;
use Symfony\Component\Console\Output\BufferedOutput;
use Symfony\Component\Console\Output\OutputInterface;
class ApplicationTest extends TestCase
{

@ -86,7 +86,6 @@ class PoolOptimizerTest extends TestCase
$requestData = JsonFile::parseJson($testData['REQUEST']);
$packagesBefore = $this->loadPackages(JsonFile::parseJson($testData['POOL-BEFORE']));
$expectedPackages = $this->loadPackages(JsonFile::parseJson($testData['POOL-AFTER']));
} catch (\Exception $e) {
die(sprintf('Test "%s" is not valid: '.$e->getMessage(), str_replace($fixturesDir.'/', '', $file)));
}
@ -193,6 +192,7 @@ class PoolOptimizerTest extends TestCase
private function loadPackage(array $packageData)
{
$loader = new ArrayLoader();
return $loader->load($packageData);
}
}

@ -12,13 +12,11 @@
namespace Composer\Test\Downloader;
use Composer\Config;
use Composer\Downloader\FileDownloader;
use Composer\EventDispatcher\EventDispatcher;
use Composer\Plugin\PluginEvents;
use Composer\Plugin\PreFileDownloadEvent;
use Composer\Test\TestCase;
use Composer\Test\Mock\ProcessExecutorMock;
use Composer\Util\Filesystem;
use Composer\Util\Http\Response;
use Composer\Util\Loop;

@ -15,7 +15,6 @@ namespace Composer\Test\Downloader;
use Composer\Downloader\FossilDownloader;
use Composer\Test\TestCase;
use Composer\Util\Filesystem;
use Composer\Test\Mock\ProcessExecutorMock;
class FossilDownloaderTest extends TestCase
{

@ -18,7 +18,6 @@ use Composer\Pcre\Preg;
use Composer\Test\TestCase;
use Composer\Util\Filesystem;
use Composer\Util\Platform;
use Composer\Test\Mock\ProcessExecutorMock;
class GitDownloaderTest extends TestCase
{

@ -15,7 +15,6 @@ namespace Composer\Test\Downloader;
use Composer\Downloader\HgDownloader;
use Composer\Test\TestCase;
use Composer\Util\Filesystem;
use Composer\Test\Mock\ProcessExecutorMock;
class HgDownloaderTest extends TestCase
{

@ -18,8 +18,6 @@ use Composer\Repository\VcsRepository;
use Composer\IO\IOInterface;
use Composer\Test\TestCase;
use Composer\Factory;
use Composer\Util\Filesystem;
use Composer\Test\Mock\ProcessExecutorMock;
/**
* @author Matt Whittom <Matt.Whittom@veteransunited.com>

@ -23,7 +23,6 @@ use Composer\IO\BufferIO;
use Composer\Script\ScriptEvents;
use Composer\Script\Event as ScriptEvent;
use Composer\Util\ProcessExecutor;
use Composer\Test\Mock\ProcessExecutorMock;
use Composer\Util\Platform;
use Symfony\Component\Console\Output\OutputInterface;
@ -148,7 +147,7 @@ class EventDispatcherTest extends TestCase
->will($this->returnValue(array()));
$generator
->method('parseAutoloads')
->will($this->returnValue(array('psr-0' => array(), 'psr-4' => array(), 'classmap' => array(), 'files' => array(), 'exclude-from-classmap' => array(),)));
->will($this->returnValue(array('psr-0' => array(), 'psr-4' => array(), 'classmap' => array(), 'files' => array(), 'exclude-from-classmap' => array())));
$generator
->method('createLoader')
->will($this->returnValue($this->getMockBuilder('Composer\Autoload\ClassLoader')->getMock()));

@ -1,5 +1,15 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Test\Filter\PlatformRequirementFilter;
use Composer\Filter\PlatformRequirementFilter\IgnoreAllPlatformRequirementFilter;

@ -1,5 +1,15 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Test\Filter\PlatformRequirementFilter;
use Composer\Filter\PlatformRequirementFilter\IgnoreListPlatformRequirementFilter;

@ -1,5 +1,15 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Test\Filter\PlatformRequirementFilter;
use Composer\Filter\PlatformRequirementFilter\IgnoreNothingPlatformRequirementFilter;

@ -1,5 +1,15 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer\Test\Filter\PlatformRequirementFilter;
use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterFactory;

@ -15,8 +15,6 @@ namespace Composer\Test\Installer;
use Composer\Installer\BinaryInstaller;
use Composer\Util\Filesystem;
use Composer\Test\TestCase;
use Composer\Composer;
use Composer\Config;
use Composer\Util\ProcessExecutor;
class BinaryInstallerTest extends TestCase
@ -106,7 +104,7 @@ echo 'success '.$_SERVER['argv'][1];
EOL
),
'phar file' => array(
base64_decode('IyEvdXNyL2Jpbi9lbnYgcGhwCjw/cGhwCgpQaGFyOjptYXBQaGFyKCd0ZXN0LnBoYXInKTsKCnJlcXVpcmUgJ3BoYXI6Ly90ZXN0LnBoYXIvcnVuLnBocCc7CgpfX0hBTFRfQ09NUElMRVIoKTsgPz4NCj4AAAABAAAAEQAAAAEACQAAAHRlc3QucGhhcgAAAAAHAAAAcnVuLnBocCoAAADb9n9hKgAAAMUDDWGkAQAAAAAAADw/cGhwIGVjaG8gInN1Y2Nlc3MgIi4kX1NFUlZFUlsiYXJndiJdWzFdO1SOC0IE3+UN0yzrHIwyspp9slhmAgAAAEdCTUI=')
base64_decode('IyEvdXNyL2Jpbi9lbnYgcGhwCjw/cGhwCgpQaGFyOjptYXBQaGFyKCd0ZXN0LnBoYXInKTsKCnJlcXVpcmUgJ3BoYXI6Ly90ZXN0LnBoYXIvcnVuLnBocCc7CgpfX0hBTFRfQ09NUElMRVIoKTsgPz4NCj4AAAABAAAAEQAAAAEACQAAAHRlc3QucGhhcgAAAAAHAAAAcnVuLnBocCoAAADb9n9hKgAAAMUDDWGkAQAAAAAAADw/cGhwIGVjaG8gInN1Y2Nlc3MgIi4kX1NFUlZFUlsiYXJndiJdWzFdO1SOC0IE3+UN0yzrHIwyspp9slhmAgAAAEdCTUI='),
),
'shebang with strict types declare' => array(<<<'EOL'
#!/usr/bin/env php

@ -204,7 +204,7 @@ class SuggestedPackagesReporterTest extends TestCase
$this->suggestedPackagesReporter->addPackage('a', 'b', 'c');
$this->suggestedPackagesReporter->addPackage('source package', 'target', 'because reasons');
$this->io->expects($this->exactly(6))
$this->io->expects($this->exactly(6))
->method('write')
->withConsecutive(
['<comment>a</comment> suggests:'],

@ -298,7 +298,6 @@ class JsonFileTest extends TestCase
public function testUnicode()
{
$data = array("Žluťoučký \" kůň" => "úpěl ďábelské ódy za €");
$json = '{
"Žluťoučký \" kůň": "úpěl ďábelské ódy za €"
@ -309,7 +308,6 @@ class JsonFileTest extends TestCase
public function testOnlyUnicode()
{
$data = "\\/ƌ";
$this->assertJsonFormat('"\\\\\\/ƌ"', $data, JSON_UNESCAPED_UNICODE);

@ -15,7 +15,6 @@ namespace Composer\Test\Mock;
use Composer\Util\ProcessExecutor;
use Composer\Util\Platform;
use PHPUnit\Framework\Assert;
use PHPUnit\Framework\TestCase;
use PHPUnit\Framework\AssertionFailedError;
use Symfony\Component\Process\Process;
use React\Promise\Promise;

@ -117,7 +117,7 @@ class BasePackageTest extends TestCase
array('php'), '{^%s$}i', '{^php$}i',
array('*'), '{^%s$}i', '{^.*$}i',
array('foo', 'bar'), '§%s§', '§foo|bar§',
)
),
);
}
}

@ -18,7 +18,6 @@ use Composer\Semver\VersionParser;
use Composer\Test\TestCase;
use Composer\Util\Git as GitUtil;
use Composer\Util\ProcessExecutor;
use Composer\Test\Mock\ProcessExecutorMock;
class VersionGuesserTest extends TestCase
{

@ -16,7 +16,6 @@ use Composer\Question\StrictConfirmationQuestion;
use Composer\Test\TestCase;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\StreamableInputInterface;
use Symfony\Component\Console\Output\StreamOutput;
/**

@ -17,10 +17,8 @@ use Composer\Json\JsonFile;
use Composer\Repository\ComposerRepository;
use Composer\Repository\RepositoryInterface;
use Composer\Test\Mock\FactoryMock;
use Composer\Test\Mock\HttpDownloaderMock;
use Composer\Test\TestCase;
use Composer\Package\Loader\ArrayLoader;
use Composer\Package\Version\VersionParser;
class ComposerRepositoryTest extends TestCase
{

@ -1090,7 +1090,6 @@ Linked Version => 1.2.11',
* @param list<mixed> $constants
* @param list<mixed> $classDefinitions
*/
public function testLibraryInformation(
$extensions,
$info,

@ -12,13 +12,11 @@
namespace Composer\Test\Repository\Vcs;
use Composer\Downloader\TransportException;
use Composer\Repository\Vcs\GitHubDriver;
use Composer\Test\Mock\ProcessExecutorMock;
use Composer\Test\TestCase;
use Composer\Util\Filesystem;
use Composer\Config;
use Composer\Util\Http\Response;
use Composer\Util\ProcessExecutor;
class GitHubDriverTest extends TestCase
@ -119,7 +117,6 @@ class GitHubDriverTest extends TestCase
->method('isInteractive')
->will($this->returnValue(true));
$httpDownloader = $this->getHttpDownloaderMock($io, $this->config);
$httpDownloader->expects(
[
@ -162,7 +159,6 @@ class GitHubDriverTest extends TestCase
->method('isInteractive')
->will($this->returnValue(true));
$httpDownloader = $this->getHttpDownloaderMock($io, $this->config);
$httpDownloader->expects(
[

@ -21,7 +21,6 @@ use Composer\Test\TestCase;
use Composer\Util\Filesystem;
use Composer\Util\ProcessExecutor;
use PHPUnit\Framework\MockObject\MockObject;
use Prophecy\Argument;
use Composer\Util\Http\Response;
/**

@ -16,7 +16,6 @@ use Composer\Repository\Vcs\SvnDriver;
use Composer\Config;
use Composer\Test\TestCase;
use Composer\Util\Filesystem;
use Composer\Test\Mock\ProcessExecutorMock;
use Composer\Util\ProcessExecutor;
class SvnDriverTest extends TestCase

@ -16,7 +16,6 @@ use Composer\Config;
use Composer\IO\IOInterface;
use Composer\Pcre\Preg;
use Composer\Semver\VersionParser;
use Composer\Package\RootPackageInterface;
use Composer\Package\PackageInterface;
use Composer\Semver\Constraint\Constraint;
use Composer\Test\Mock\HttpDownloaderMock;
@ -32,7 +31,6 @@ use Composer\Package\AliasPackage;
use Composer\Package\RootAliasPackage;
use Composer\Package\CompletePackage;
use Composer\Package\CompleteAliasPackage;
use Composer\Package\CompletePackageInterface;
use Composer\Package\Package;
abstract class TestCase extends \PHPUnit\Framework\TestCase

@ -15,7 +15,6 @@ namespace Composer\Test\Util;
use Composer\Util\Bitbucket;
use Composer\Util\Http\Response;
use Composer\Test\TestCase;
use Composer\Test\Mock\ProcessExecutorMock;
/**
* @author Paul Wenke <wenke.paul@gmail.com>

@ -12,10 +12,7 @@
namespace Composer\Test\Util;
use _PHPStan_c862bb974\Symfony\Component\Console\Output\BufferedOutput;
use Composer\Downloader\TransportException;
use Composer\Util\GitHub;
use Composer\Util\Http\Response;
use Composer\Test\TestCase;
/**

@ -12,10 +12,7 @@
namespace Composer\Test\Util;
use Composer\Downloader\TransportException;
use Composer\Test\Mock\HttpDownloaderMock;
use Composer\Util\GitLab;
use Composer\Util\Http\Response;
use Composer\Test\TestCase;
/**

@ -195,7 +195,7 @@ class PerforceTest extends TestCase
$this->processExecutor->expects(
[
'p4 set',
$expectedCommand
$expectedCommand,
],
true
);
@ -216,7 +216,7 @@ class PerforceTest extends TestCase
$this->processExecutor->expects(
[
'echo $P4USER',
$expectedCommand
$expectedCommand,
],
true
);
@ -348,11 +348,11 @@ class PerforceTest extends TestCase
[
[
'cmd' => 'p4 -u user -c composer_perforce_TEST_depot_branch -p port streams '.ProcessExecutor::escape('//depot/...'),
'stdout' => 'Stream //depot/branch mainline none \'branch\'' . PHP_EOL
'stdout' => 'Stream //depot/branch mainline none \'branch\'' . PHP_EOL,
],
[
'cmd' => 'p4 -u user -p port changes '.ProcessExecutor::escape('//depot/branch/...'),
'stdout' => 'Change 1234 on 2014/03/19 by Clark.Stuth@Clark.Stuth_test_client \'test changelist\''
'stdout' => 'Change 1234 on 2014/03/19 by Clark.Stuth@Clark.Stuth_test_client \'test changelist\'',
],
],
true
@ -368,7 +368,7 @@ class PerforceTest extends TestCase
[
[
'cmd' => 'p4 -u user -p port changes '.ProcessExecutor::escape('//depot/...'),
'stdout' => 'Change 5678 on 2014/03/19 by Clark.Stuth@Clark.Stuth_test_client \'test changelist\''
'stdout' => 'Change 5678 on 2014/03/19 by Clark.Stuth@Clark.Stuth_test_client \'test changelist\'',
],
],
true
@ -384,7 +384,7 @@ class PerforceTest extends TestCase
[
[
'cmd' => 'p4 -u user -c composer_perforce_TEST_depot -p port labels',
'stdout' => 'Label 0.0.1 2013/07/31 \'First Label!\'' . PHP_EOL . 'Label 0.0.2 2013/08/01 \'Second Label!\'' . PHP_EOL
'stdout' => 'Label 0.0.1 2013/07/31 \'First Label!\'' . PHP_EOL . 'Label 0.0.2 2013/08/01 \'Second Label!\'' . PHP_EOL,
],
],
true
@ -403,7 +403,7 @@ class PerforceTest extends TestCase
[
[
'cmd' => 'p4 -u user -c composer_perforce_TEST_depot_branch -p port labels',
'stdout' => 'Label 0.0.1 2013/07/31 \'First Label!\'' . PHP_EOL . 'Label 0.0.2 2013/08/01 \'Second Label!\'' . PHP_EOL
'stdout' => 'Label 0.0.1 2013/07/31 \'First Label!\'' . PHP_EOL . 'Label 0.0.2 2013/08/01 \'Second Label!\'' . PHP_EOL,
],
],
true
@ -427,7 +427,7 @@ class PerforceTest extends TestCase
[
[
'cmd' => 'p4 -u user -p port depots',
'stdout' => 'Depot depot 2013/06/25 stream /p4/1/depots/depot/... \'Created by Me\''
'stdout' => 'Depot depot 2013/06/25 stream /p4/1/depots/depot/... \'Created by Me\'',
],
],
true
@ -444,7 +444,7 @@ class PerforceTest extends TestCase
[
[
'cmd' => 'p4 -u user -c composer_perforce_TEST_depot -p port print '.ProcessExecutor::escape('//depot/composer.json'),
'stdout' => PerforceTest::getComposerJson()
'stdout' => PerforceTest::getComposerJson(),
],
],
true
@ -466,11 +466,11 @@ class PerforceTest extends TestCase
[
[
'cmd' => 'p4 -u user -p port files '.ProcessExecutor::escape('//depot/composer.json@0.0.1'),
'stdout' => '//depot/composer.json#1 - branch change 10001 (text)'
'stdout' => '//depot/composer.json#1 - branch change 10001 (text)',
],
[
'cmd' => 'p4 -u user -c composer_perforce_TEST_depot -p port print '.ProcessExecutor::escape('//depot/composer.json@10001'),
'stdout' => PerforceTest::getComposerJson()
'stdout' => PerforceTest::getComposerJson(),
],
],
true
@ -495,7 +495,7 @@ class PerforceTest extends TestCase
[
[
'cmd' => 'p4 -u user -c composer_perforce_TEST_depot_branch -p port print '.ProcessExecutor::escape('//depot/branch/composer.json'),
'stdout' => PerforceTest::getComposerJson()
'stdout' => PerforceTest::getComposerJson(),
],
],
true
@ -605,8 +605,8 @@ class PerforceTest extends TestCase
'description' => 'Basic project for testing',
'minimum-stability' => 'dev',
'autoload' => [
'psr-0' => []
]
'psr-0' => [],
],
], JSON_FORCE_OBJECT);
}

@ -1,5 +1,15 @@
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
require __DIR__ . '/../vendor/autoload.php';
return new \Composer\Console\Application();

Loading…
Cancel
Save