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

Fixes from PHPStan (#7687)

* fix docblocks

* remove redundant conditional

* fix wrong variable name

* fix wrong namespaces

* add missing private members

* remove unused/redundant arguments

* move testcase class

* exclude TestCase.php

* Tweak RuleWatchGraph type hints

* Tweak doc comment
This commit is contained in:
Gabriel Caruso 2018-11-12 12:23:32 -02:00 committed by Jordi Boggiano
parent 38a34159ef
commit 2a13bb2649
86 changed files with 163 additions and 166 deletions

View file

@ -60,7 +60,7 @@ before_script:
script: script:
# run test suite directories in parallel using GNU parallel # run test suite directories in parallel using GNU parallel
- ls -d tests/Composer/Test/* | parallel --gnu --keep-order 'echo "Running {} tests"; ./vendor/bin/phpunit -c tests/complete.phpunit.xml --colors=always {} || (echo -e "\e[41mFAILED\e[0m {}" && exit 1);' - ls -d tests/Composer/Test/* | grep -v TestCase.php | parallel --gnu --keep-order 'echo "Running {} tests"; ./vendor/bin/phpunit -c tests/complete.phpunit.xml --colors=always {} || (echo -e "\e[41mFAILED\e[0m {}" && exit 1);'
before_deploy: before_deploy:
- php -d phar.readonly=0 bin/compile - php -d phar.readonly=0 bin/compile

View file

@ -33,7 +33,7 @@ use Symfony\Component\Console\Command\Command;
abstract class BaseCommand extends Command abstract class BaseCommand extends Command
{ {
/** /**
* @var Composer * @var Composer|null
*/ */
private $composer; private $composer;

View file

@ -737,7 +737,7 @@ EOT
/** /**
* Display the tree * Display the tree
* *
* @param $arrayTree * @param array $arrayTree
*/ */
protected function displayPackageTree(array $arrayTree) protected function displayPackageTree(array $arrayTree)
{ {
@ -782,7 +782,7 @@ EOT
/** /**
* Generate the package tree * Generate the package tree
* *
* @param PackageInterface|string $package * @param PackageInterface $package
* @param RepositoryInterface $installedRepo * @param RepositoryInterface $installedRepo
* @param RepositoryInterface $distantRepos * @param RepositoryInterface $distantRepos
* @return array * @return array
@ -792,38 +792,36 @@ EOT
RepositoryInterface $installedRepo, RepositoryInterface $installedRepo,
RepositoryInterface $distantRepos RepositoryInterface $distantRepos
) { ) {
if (is_object($package)) { $requires = $package->getRequires();
$requires = $package->getRequires(); ksort($requires);
ksort($requires); $children = array();
$children = array(); foreach ($requires as $requireName => $require) {
foreach ($requires as $requireName => $require) { $packagesInTree = array($package->getName(), $requireName);
$packagesInTree = array($package->getName(), $requireName);
$treeChildDesc = array( $treeChildDesc = array(
'name' => $requireName, 'name' => $requireName,
'version' => $require->getPrettyConstraint(), 'version' => $require->getPrettyConstraint(),
);
$deepChildren = $this->addTree($requireName, $require, $installedRepo, $distantRepos, $packagesInTree);
if ($deepChildren) {
$treeChildDesc['requires'] = $deepChildren;
}
$children[] = $treeChildDesc;
}
$tree = array(
'name' => $package->getPrettyName(),
'version' => $package->getPrettyVersion(),
'description' => $package->getDescription(),
); );
if ($children) { $deepChildren = $this->addTree($requireName, $require, $installedRepo, $distantRepos, $packagesInTree);
$tree['requires'] = $children;
if ($deepChildren) {
$treeChildDesc['requires'] = $deepChildren;
} }
return $tree; $children[] = $treeChildDesc;
} }
$tree = array(
'name' => $package->getPrettyName(),
'version' => $package->getPrettyVersion(),
'description' => $package->getDescription(),
);
if ($children) {
$tree['requires'] = $children;
}
return $tree;
} }
/** /**

View file

@ -50,7 +50,7 @@ class RuleSetGenerator
* reason for generating this rule * reason for generating this rule
* @param mixed $reasonData Any data, e.g. the requirement name, * @param mixed $reasonData Any data, e.g. the requirement name,
* that goes with the reason * that goes with the reason
* @return Rule The generated rule or null if tautological * @return Rule|null The generated rule or null if tautological
*/ */
protected function createRequireRule(PackageInterface $package, array $providers, $reason, $reasonData = null) protected function createRequireRule(PackageInterface $package, array $providers, $reason, $reasonData = null)
{ {
@ -117,7 +117,7 @@ class RuleSetGenerator
* reason for generating this rule * reason for generating this rule
* @param mixed $reasonData Any data, e.g. the package name, that * @param mixed $reasonData Any data, e.g. the package name, that
* goes with the reason * goes with the reason
* @return Rule The generated rule * @return Rule|null The generated rule
*/ */
protected function createRule2Literals(PackageInterface $issuer, PackageInterface $provider, $reason, $reasonData = null) protected function createRule2Literals(PackageInterface $issuer, PackageInterface $provider, $reason, $reasonData = null)
{ {

View file

@ -127,9 +127,9 @@ class RuleWatchGraph
* *
* The rule node's watched literals are updated accordingly. * The rule node's watched literals are updated accordingly.
* *
* @param $fromLiteral mixed A literal the node used to watch * @param int $fromLiteral A literal the node used to watch
* @param $toLiteral mixed A literal the node should watch now * @param int $toLiteral A literal the node should watch now
* @param $node mixed The rule node to be moved * @param RuleWatchNode $node The rule node to be moved
*/ */
protected function moveWatch($fromLiteral, $toLiteral, $node) protected function moveWatch($fromLiteral, $toLiteral, $node)
{ {

View file

@ -433,7 +433,7 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
} }
/** /**
* @param $path * @param string $path
* @throws \RuntimeException * @throws \RuntimeException
*/ */
protected function discardChanges($path) protected function discardChanges($path)
@ -447,7 +447,7 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
} }
/** /**
* @param $path * @param string $path
* @throws \RuntimeException * @throws \RuntimeException
*/ */
protected function stashChanges($path) protected function stashChanges($path)
@ -461,7 +461,7 @@ class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface
} }
/** /**
* @param $path * @param string $path
* @throws \RuntimeException * @throws \RuntimeException
*/ */
protected function viewDiff($path) protected function viewDiff($path)

View file

@ -73,8 +73,8 @@ class PearPackageExtractor
* Perform copy actions on files * Perform copy actions on files
* *
* @param array $files array of copy actions ('from', 'to') with relative paths * @param array $files array of copy actions ('from', 'to') with relative paths
* @param $source string path to source dir. * @param string $source path to source dir.
* @param $target string path to destination dir * @param string $target path to destination dir
* @param array $roles array [role => roleRoot] relative root for files having that role * @param array $roles array [role => roleRoot] relative root for files having that role
* @param array $vars list of values can be used for replacement tasks * @param array $vars list of values can be used for replacement tasks
*/ */
@ -135,7 +135,7 @@ class PearPackageExtractor
*/ */
private function buildCopyActions($source, array $roles, $vars) private function buildCopyActions($source, array $roles, $vars)
{ {
/** @var $package \SimpleXmlElement */ /** @var \SimpleXmlElement $package */
$package = simplexml_load_string(file_get_contents($this->combine($source, 'package.xml'))); $package = simplexml_load_string(file_get_contents($this->combine($source, 'package.xml')));
if (false === $package) { if (false === $package) {
throw new \RuntimeException('Package definition file is not valid.'); throw new \RuntimeException('Package definition file is not valid.');

View file

@ -264,7 +264,7 @@ class EventDispatcher
$finder = new PhpExecutableFinder(); $finder = new PhpExecutableFinder();
$phpPath = $finder->find(); $phpPath = $finder->find();
if (!$phpPath) { if (!$phpPath) {
throw new \RuntimeException('Failed to locate PHP binary to execute '.$scriptName); throw new \RuntimeException('Failed to locate PHP binary to execute '.$phpPath);
} }
$allowUrlFOpenFlag = ' -d allow_url_fopen=' . ProcessExecutor::escape(ini_get('allow_url_fopen')); $allowUrlFOpenFlag = ' -d allow_url_fopen=' . ProcessExecutor::escape(ini_get('allow_url_fopen'));

View file

@ -64,7 +64,7 @@ class GitExcludeFilter extends BaseExcludeFilter
* *
* @param string $line A line from .gitattributes * @param string $line A line from .gitattributes
* *
* @return array An exclude pattern for filter() * @return array|null An exclude pattern for filter()
*/ */
public function parseGitAttributesLine($line) public function parseGitAttributesLine($line)
{ {

View file

@ -54,7 +54,7 @@ class HgExcludeFilter extends BaseExcludeFilter
* *
* @param string $line A line from .hgignore * @param string $line A line from .hgignore
* *
* @return array An exclude pattern for filter() * @return array|null An exclude pattern for filter()
*/ */
public function parseHgIgnoreLine($line) public function parseHgIgnoreLine($line)
{ {

View file

@ -37,7 +37,7 @@ class ZipArchiver implements ArchiverInterface
if ($res === true) { if ($res === true) {
$files = new ArchivableFilesFinder($sources, $excludes, $ignoreFilters); $files = new ArchivableFilesFinder($sources, $excludes, $ignoreFilters);
foreach ($files as $file) { foreach ($files as $file) {
/** @var $file \SplFileInfo */ /** @var \SplFileInfo $file */
$filepath = strtr($file->getPath()."/".$file->getFilename(), '\\', '/'); $filepath = strtr($file->getPath()."/".$file->getFilename(), '\\', '/');
$localname = str_replace($sources.'/', '', $filepath); $localname = str_replace($sources.'/', '', $filepath);
if ($file->isDir()) { if ($file->isDir()) {

View file

@ -84,7 +84,7 @@ class ArtifactRepository extends ArrayRepository implements ConfigurableReposito
* Find a file by name, returning the one that has the shortest path. * Find a file by name, returning the one that has the shortest path.
* *
* @param \ZipArchive $zip * @param \ZipArchive $zip
* @param $filename * @param string $filename
* @return bool|int * @return bool|int
*/ */
private function locateFile(\ZipArchive $zip, $filename) private function locateFile(\ZipArchive $zip, $filename)

View file

@ -44,8 +44,8 @@ abstract class BaseChannelReader
/** /**
* Read content from remote filesystem. * Read content from remote filesystem.
* *
* @param $origin string server * @param string $origin server
* @param $path string relative path to content * @param string $path relative path to content
* @throws \UnexpectedValueException * @throws \UnexpectedValueException
* @return \SimpleXMLElement * @return \SimpleXMLElement
*/ */
@ -63,8 +63,8 @@ abstract class BaseChannelReader
/** /**
* Read xml content from remote filesystem * Read xml content from remote filesystem
* *
* @param $origin string server * @param string $origin server
* @param $path string relative path to content * @param string $path relative path to content
* @throws \UnexpectedValueException * @throws \UnexpectedValueException
* @return \SimpleXMLElement * @return \SimpleXMLElement
*/ */

View file

@ -44,7 +44,7 @@ class ChannelReader extends BaseChannelReader
/** /**
* Reads PEAR channel through REST interface and builds list of packages * Reads PEAR channel through REST interface and builds list of packages
* *
* @param $url string PEAR Channel url * @param string $url PEAR Channel url
* @throws \UnexpectedValueException * @throws \UnexpectedValueException
* @return ChannelInfo * @return ChannelInfo
*/ */
@ -70,8 +70,8 @@ class ChannelReader extends BaseChannelReader
/** /**
* Reads channel supported REST interfaces and selects one of them * Reads channel supported REST interfaces and selects one of them
* *
* @param $channelXml \SimpleXMLElement * @param \SimpleXMLElement $channelXml
* @param $supportedVersions string[] supported PEAR REST protocols * @param string[] $supportedVersions supported PEAR REST protocols
* @return array|null hash with selected version and baseUrl * @return array|null hash with selected version and baseUrl
*/ */
private function selectRestVersion($channelXml, $supportedVersions) private function selectRestVersion($channelXml, $supportedVersions)

View file

@ -39,7 +39,7 @@ class ChannelRest10Reader extends BaseChannelReader
/** /**
* Reads package descriptions using PEAR Rest 1.0 interface * Reads package descriptions using PEAR Rest 1.0 interface
* *
* @param $baseUrl string base Url interface * @param string $baseUrl base Url interface
* *
* @return PackageInfo[] * @return PackageInfo[]
*/ */
@ -52,7 +52,7 @@ class ChannelRest10Reader extends BaseChannelReader
* Read list of packages from * Read list of packages from
* {baseUrl}/p/packages.xml * {baseUrl}/p/packages.xml
* *
* @param $baseUrl string * @param string $baseUrl
* @return PackageInfo[] * @return PackageInfo[]
*/ */
private function readPackages($baseUrl) private function readPackages($baseUrl)
@ -75,8 +75,8 @@ class ChannelRest10Reader extends BaseChannelReader
* Read package info from * Read package info from
* {baseUrl}/p/{package}/info.xml * {baseUrl}/p/{package}/info.xml
* *
* @param $baseUrl string * @param string $baseUrl
* @param $packageName string * @param string $packageName
* @return PackageInfo * @return PackageInfo
*/ */
private function readPackage($baseUrl, $packageName) private function readPackage($baseUrl, $packageName)
@ -105,8 +105,8 @@ class ChannelRest10Reader extends BaseChannelReader
* Read package releases from * Read package releases from
* {baseUrl}/p/{package}/allreleases.xml * {baseUrl}/p/{package}/allreleases.xml
* *
* @param $baseUrl string * @param string $baseUrl
* @param $packageName string * @param string $packageName
* @throws \Composer\Downloader\TransportException|\Exception * @throws \Composer\Downloader\TransportException|\Exception
* @return ReleaseInfo[] hash array with keys as version numbers * @return ReleaseInfo[] hash array with keys as version numbers
*/ */
@ -146,9 +146,9 @@ class ChannelRest10Reader extends BaseChannelReader
* Read package dependencies from * Read package dependencies from
* {baseUrl}/p/{package}/deps.{version}.txt * {baseUrl}/p/{package}/deps.{version}.txt
* *
* @param $baseUrl string * @param string $baseUrl
* @param $packageName string * @param string $packageName
* @param $version string * @param string $version
* @return DependencyInfo[] * @return DependencyInfo[]
*/ */
private function readPackageReleaseDependencies($baseUrl, $packageName, $version) private function readPackageReleaseDependencies($baseUrl, $packageName, $version)

View file

@ -35,7 +35,7 @@ class ChannelRest11Reader extends BaseChannelReader
/** /**
* Reads package descriptions using PEAR Rest 1.1 interface * Reads package descriptions using PEAR Rest 1.1 interface
* *
* @param $baseUrl string base Url interface * @param string $baseUrl base Url interface
* *
* @return PackageInfo[] * @return PackageInfo[]
*/ */
@ -48,7 +48,7 @@ class ChannelRest11Reader extends BaseChannelReader
* Read list of channel categories from * Read list of channel categories from
* {baseUrl}/c/categories.xml * {baseUrl}/c/categories.xml
* *
* @param $baseUrl string * @param string $baseUrl
* @return PackageInfo[] * @return PackageInfo[]
*/ */
private function readChannelPackages($baseUrl) private function readChannelPackages($baseUrl)
@ -70,8 +70,8 @@ class ChannelRest11Reader extends BaseChannelReader
* Read packages from * Read packages from
* {baseUrl}/c/{category}/packagesinfo.xml * {baseUrl}/c/{category}/packagesinfo.xml
* *
* @param $baseUrl string * @param string $baseUrl
* @param $categoryName string * @param string $categoryName
* @return PackageInfo[] * @return PackageInfo[]
*/ */
private function readCategoryPackages($baseUrl, $categoryName) private function readCategoryPackages($baseUrl, $categoryName)
@ -92,7 +92,7 @@ class ChannelRest11Reader extends BaseChannelReader
/** /**
* Parses package node. * Parses package node.
* *
* @param $packageInfo \SimpleXMLElement xml element describing package * @param \SimpleXMLElement $packageInfo xml element describing package
* @return PackageInfo * @return PackageInfo
*/ */
private function parsePackage($packageInfo) private function parsePackage($packageInfo)

View file

@ -22,7 +22,7 @@ class PackageDependencyParser
/** /**
* Builds dependency information. It detects used package.xml format. * Builds dependency information. It detects used package.xml format.
* *
* @param $depArray array * @param array $depArray
* @return DependencyInfo * @return DependencyInfo
*/ */
public function buildDependencyInfo($depArray) public function buildDependencyInfo($depArray)
@ -46,7 +46,7 @@ class PackageDependencyParser
* { type="php|os|sapi|ext|pkg" rel="has|not|eq|ge|gt|le|lt" optional="yes" * { type="php|os|sapi|ext|pkg" rel="has|not|eq|ge|gt|le|lt" optional="yes"
* channel="channelName" name="extName|packageName" } * channel="channelName" name="extName|packageName" }
* *
* @param $depArray array Dependency data in package.xml 1.0 format * @param array $depArray Dependency data in package.xml 1.0 format
* @return DependencyConstraint[] * @return DependencyConstraint[]
*/ */
private function buildDependency10Info($depArray) private function buildDependency10Info($depArray)
@ -115,7 +115,7 @@ class PackageDependencyParser
/** /**
* Builds dependency information from package.xml 2.0 format * Builds dependency information from package.xml 2.0 format
* *
* @param $depArray array Dependency data in package.xml 1.0 format * @param array $depArray Dependency data in package.xml 1.0 format
* @return DependencyInfo * @return DependencyInfo
*/ */
private function buildDependency20Info($depArray) private function buildDependency20Info($depArray)
@ -187,8 +187,8 @@ class PackageDependencyParser
/** /**
* Builds dependency constraint of 'extension' type * Builds dependency constraint of 'extension' type
* *
* @param $depItem array dependency constraint or array of dependency constraints * @param array $depItem dependency constraint or array of dependency constraints
* @param $depType string target type of building constraint. * @param string $depType target type of building constraint.
* @return DependencyConstraint[] * @return DependencyConstraint[]
*/ */
private function buildDepExtensionConstraints($depItem, $depType) private function buildDepExtensionConstraints($depItem, $depType)
@ -217,8 +217,8 @@ class PackageDependencyParser
/** /**
* Builds dependency constraint of 'package' type * Builds dependency constraint of 'package' type
* *
* @param $depItem array dependency constraint or array of dependency constraints * @param array $depItem dependency constraint or array of dependency constraints
* @param $depType string target type of building constraint. * @param string $depType target type of building constraint.
* @return DependencyConstraint[] * @return DependencyConstraint[]
*/ */
private function buildDepPackageConstraints($depItem, $depType) private function buildDepPackageConstraints($depItem, $depType)
@ -287,7 +287,7 @@ class PackageDependencyParser
/** /**
* Softened version parser * Softened version parser
* *
* @param $version * @param string $version
* @return null|string * @return null|string
*/ */
private function parseVersion($version) private function parseVersion($version)

View file

@ -264,8 +264,8 @@ class Filesystem
/** /**
* Copies a file or directory from $source to $target. * Copies a file or directory from $source to $target.
* *
* @param $source * @param string $source
* @param $target * @param string $target
* @return bool * @return bool
*/ */
public function copy($source, $target) public function copy($source, $target)

View file

@ -35,7 +35,7 @@ class NoProxyPattern
* *
* @param string $url * @param string $url
* *
* @return true if the URL matches one of the rules. * @return bool true if the URL matches one of the rules.
*/ */
public function test($url) public function test($url)
{ {

View file

@ -515,7 +515,7 @@ class Perforce
} }
/** /**
* @param $reference * @param string $reference
* @return mixed|null * @return mixed|null
*/ */
protected function getChangeList($reference) protected function getChangeList($reference)
@ -537,8 +537,8 @@ class Perforce
} }
/** /**
* @param $fromReference * @param string $fromReference
* @param $toReference * @param string $toReference
* @return mixed|null * @return mixed|null
*/ */
public function getCommitLogs($fromReference, $toReference) public function getCommitLogs($fromReference, $toReference)

View file

@ -160,7 +160,7 @@ final class StreamContextFactory
* This method fixes the array by moving the content-type header to the end * This method fixes the array by moving the content-type header to the end
* *
* @link https://bugs.php.net/bug.php?id=61548 * @link https://bugs.php.net/bug.php?id=61548
* @param $header * @param string|array $header
* @return array * @return array
*/ */
private static function fixHttpHeaderField($header) private static function fixHttpHeaderField($header)

View file

@ -164,7 +164,7 @@ final class TlsHelper
* *
* @param string $certName CN/SAN * @param string $certName CN/SAN
* *
* @return callable|null * @return callable|void
*/ */
private static function certNameMatcher($certName) private static function certNameMatcher($certName)
{ {

View file

@ -12,7 +12,7 @@
namespace Composer\Test; namespace Composer\Test;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\Finder;
use Symfony\Component\Process\Process; use Symfony\Component\Process\Process;

View file

@ -13,7 +13,7 @@
namespace Composer\Test; namespace Composer\Test;
use Composer\Console\Application; use Composer\Console\Application;
use Composer\TestCase; use Composer\Test\TestCase;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
class ApplicationTest extends TestCase class ApplicationTest extends TestCase

View file

@ -17,7 +17,7 @@ use Composer\Package\Link;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\Package\AliasPackage; use Composer\Package\AliasPackage;
use Composer\Package\Package; use Composer\Package\Package;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Script\ScriptEvents; use Composer\Script\ScriptEvents;
use Composer\Repository\InstalledRepositoryInterface; use Composer\Repository\InstalledRepositoryInterface;
use Composer\Installer\InstallationManager; use Composer\Installer\InstallationManager;

View file

@ -19,7 +19,7 @@
namespace Composer\Test\Autoload; namespace Composer\Test\Autoload;
use Composer\Autoload\ClassMapGenerator; use Composer\Autoload\ClassMapGenerator;
use Composer\TestCase; use Composer\Test\TestCase;
use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\Finder;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;

View file

@ -12,7 +12,7 @@
namespace Composer\Test; namespace Composer\Test;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
class CacheTest extends TestCase class CacheTest extends TestCase

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Command; namespace Composer\Test\Command;
use Composer\Command\InitCommand; use Composer\Command\InitCommand;
use Composer\TestCase; use Composer\Test\TestCase;
class InitCommandTest extends TestCase class InitCommandTest extends TestCase
{ {

View file

@ -15,7 +15,7 @@ namespace Composer\Test\Command;
use Composer\Composer; use Composer\Composer;
use Composer\Config; use Composer\Config;
use Composer\Script\Event as ScriptEvent; use Composer\Script\Event as ScriptEvent;
use Composer\TestCase; use Composer\Test\TestCase;
class RunScriptCommandTest extends TestCase class RunScriptCommandTest extends TestCase
{ {

View file

@ -13,7 +13,7 @@
namespace Composer\Test; namespace Composer\Test;
use Composer\Composer; use Composer\Composer;
use Composer\TestCase; use Composer\Test\TestCase;
class ComposerTest extends TestCase class ComposerTest extends TestCase
{ {

View file

@ -10,11 +10,11 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Composer\Test\Json; namespace Composer\Test\Config;
use Composer\Config\JsonConfigSource; use Composer\Config\JsonConfigSource;
use Composer\Json\JsonFile; use Composer\Json\JsonFile;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
class JsonConfigSourceTest extends TestCase class JsonConfigSourceTest extends TestCase

View file

@ -13,7 +13,7 @@
namespace Composer\Test; namespace Composer\Test;
use Composer\Config; use Composer\Config;
use PHPUnit\Framework\TestCase; use Composer\Test\TestCase;
class ConfigTest extends TestCase class ConfigTest extends TestCase
{ {

View file

@ -13,7 +13,7 @@
namespace Composer\Test; namespace Composer\Test;
use Composer\Config; use Composer\Config;
use PHPUnit\Framework\TestCase; use Composer\Test\TestCase;
class DefaultConfigTest extends TestCase class DefaultConfigTest extends TestCase
{ {

View file

@ -19,7 +19,7 @@ use Composer\DependencyResolver\Pool;
use Composer\Package\Link; use Composer\Package\Link;
use Composer\Package\AliasPackage; use Composer\Package\AliasPackage;
use Composer\Semver\Constraint\Constraint; use Composer\Semver\Constraint\Constraint;
use Composer\TestCase; use Composer\Test\TestCase;
class DefaultPolicyTest extends TestCase class DefaultPolicyTest extends TestCase
{ {

View file

@ -15,7 +15,7 @@ namespace Composer\Test\DependencyResolver;
use Composer\DependencyResolver\Pool; use Composer\DependencyResolver\Pool;
use Composer\Repository\ArrayRepository; use Composer\Repository\ArrayRepository;
use Composer\Package\BasePackage; use Composer\Package\BasePackage;
use Composer\TestCase; use Composer\Test\TestCase;
class PoolTest extends TestCase class PoolTest extends TestCase
{ {

View file

@ -14,7 +14,7 @@ namespace Composer\Test\DependencyResolver;
use Composer\DependencyResolver\Request; use Composer\DependencyResolver\Request;
use Composer\Repository\ArrayRepository; use Composer\Repository\ArrayRepository;
use Composer\TestCase; use Composer\Test\TestCase;
class RequestTest extends TestCase class RequestTest extends TestCase
{ {

View file

@ -17,7 +17,7 @@ use Composer\DependencyResolver\Rule;
use Composer\DependencyResolver\RuleSet; use Composer\DependencyResolver\RuleSet;
use Composer\DependencyResolver\Pool; use Composer\DependencyResolver\Pool;
use Composer\Repository\ArrayRepository; use Composer\Repository\ArrayRepository;
use Composer\TestCase; use Composer\Test\TestCase;
class RuleSetTest extends TestCase class RuleSetTest extends TestCase
{ {

View file

@ -17,7 +17,7 @@ use Composer\DependencyResolver\Rule;
use Composer\DependencyResolver\RuleSet; use Composer\DependencyResolver\RuleSet;
use Composer\DependencyResolver\Pool; use Composer\DependencyResolver\Pool;
use Composer\Repository\ArrayRepository; use Composer\Repository\ArrayRepository;
use Composer\TestCase; use Composer\Test\TestCase;
class RuleTest extends TestCase class RuleTest extends TestCase
{ {

View file

@ -20,7 +20,7 @@ use Composer\DependencyResolver\Request;
use Composer\DependencyResolver\Solver; use Composer\DependencyResolver\Solver;
use Composer\DependencyResolver\SolverProblemsException; use Composer\DependencyResolver\SolverProblemsException;
use Composer\Package\Link; use Composer\Package\Link;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Semver\Constraint\MultiConstraint; use Composer\Semver\Constraint\MultiConstraint;
class SolverTest extends TestCase class SolverTest extends TestCase
@ -30,6 +30,7 @@ class SolverTest extends TestCase
protected $repoInstalled; protected $repoInstalled;
protected $request; protected $request;
protected $policy; protected $policy;
protected $solver;
public function setUp() public function setUp()
{ {
@ -37,7 +38,7 @@ class SolverTest extends TestCase
$this->repo = new ArrayRepository; $this->repo = new ArrayRepository;
$this->repoInstalled = new ArrayRepository; $this->repoInstalled = new ArrayRepository;
$this->request = new Request($this->pool); $this->request = new Request();
$this->policy = new DefaultPolicy; $this->policy = new DefaultPolicy;
$this->solver = new Solver($this->policy, $this->pool, $this->repoInstalled, new NullIO()); $this->solver = new Solver($this->policy, $this->pool, $this->repoInstalled, new NullIO());
} }

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Downloader; namespace Composer\Test\Downloader;
use Composer\Downloader\FileDownloader; use Composer\Downloader\FileDownloader;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
class FileDownloaderTest extends TestCase class FileDownloaderTest extends TestCase

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Downloader; namespace Composer\Test\Downloader;
use Composer\Downloader\FossilDownloader; use Composer\Downloader\FossilDownloader;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\Util\Platform; use Composer\Util\Platform;

View file

@ -14,7 +14,7 @@ namespace Composer\Test\Downloader;
use Composer\Downloader\GitDownloader; use Composer\Downloader\GitDownloader;
use Composer\Config; use Composer\Config;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\Util\Platform; use Composer\Util\Platform;

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Downloader; namespace Composer\Test\Downloader;
use Composer\Downloader\HgDownloader; use Composer\Downloader\HgDownloader;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\Util\Platform; use Composer\Util\Platform;

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Downloader; namespace Composer\Test\Downloader;
use Composer\Downloader\PearPackageExtractor; use Composer\Downloader\PearPackageExtractor;
use Composer\TestCase; use Composer\Test\TestCase;
class PearPackageExtractorTest extends TestCase class PearPackageExtractorTest extends TestCase
{ {

View file

@ -16,7 +16,7 @@ use Composer\Downloader\PerforceDownloader;
use Composer\Config; use Composer\Config;
use Composer\Repository\VcsRepository; use Composer\Repository\VcsRepository;
use Composer\IO\IOInterface; use Composer\IO\IOInterface;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
/** /**

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Downloader; namespace Composer\Test\Downloader;
use Composer\Downloader\XzDownloader; use Composer\Downloader\XzDownloader;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\Util\Platform; use Composer\Util\Platform;
use Composer\Util\RemoteFilesystem; use Composer\Util\RemoteFilesystem;

View file

@ -14,7 +14,7 @@ namespace Composer\Test\Downloader;
use Composer\Downloader\ZipDownloader; use Composer\Downloader\ZipDownloader;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
class ZipDownloaderTest extends TestCase class ZipDownloaderTest extends TestCase
@ -24,6 +24,8 @@ class ZipDownloaderTest extends TestCase
*/ */
private $testDir; private $testDir;
private $prophet; private $prophet;
private $io;
private $config;
public function setUp() public function setUp()
{ {
@ -46,9 +48,9 @@ class ZipDownloaderTest extends TestCase
$reflectedProperty = $reflectionClass->getProperty($name); $reflectedProperty = $reflectionClass->getProperty($name);
$reflectedProperty->setAccessible(true); $reflectedProperty->setAccessible(true);
if ($obj === null) { if ($obj === null) {
$reflectedProperty = $reflectedProperty->setValue($value); $reflectedProperty->setValue($value);
} else { } else {
$reflectedProperty = $reflectedProperty->setValue($obj, $value); $reflectedProperty->setValue($obj, $value);
} }
} }

View file

@ -17,7 +17,7 @@ use Composer\EventDispatcher\EventDispatcher;
use Composer\Installer\InstallerEvents; use Composer\Installer\InstallerEvents;
use Composer\Config; use Composer\Config;
use Composer\Composer; use Composer\Composer;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\IO\BufferIO; use Composer\IO\BufferIO;
use Composer\Script\ScriptEvents; use Composer\Script\ScriptEvents;
use Composer\Script\CommandEvent; use Composer\Script\CommandEvent;

View file

@ -13,7 +13,7 @@
namespace Composer\Test\IO; namespace Composer\Test\IO;
use Composer\IO\ConsoleIO; use Composer\IO\ConsoleIO;
use Composer\TestCase; use Composer\Test\TestCase;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
class ConsoleIOTest extends TestCase class ConsoleIOTest extends TestCase

View file

@ -13,7 +13,7 @@
namespace Composer\Test\IO; namespace Composer\Test\IO;
use Composer\IO\NullIO; use Composer\IO\NullIO;
use Composer\TestCase; use Composer\Test\TestCase;
class NullIOTest extends TestCase class NullIOTest extends TestCase
{ {

View file

@ -14,7 +14,7 @@ namespace Composer\Test\Installer;
use Composer\Installer\LibraryInstaller; use Composer\Installer\LibraryInstaller;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Composer; use Composer\Composer;
use Composer\Config; use Composer\Config;

View file

@ -29,7 +29,7 @@ use Symfony\Component\Console\Input\StringInput;
use Symfony\Component\Console\Output\StreamOutput; use Symfony\Component\Console\Output\StreamOutput;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Formatter\OutputFormatter; use Symfony\Component\Console\Formatter\OutputFormatter;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\IO\BufferIO; use Composer\IO\BufferIO;
class InstallerTest extends TestCase class InstallerTest extends TestCase

View file

@ -19,7 +19,7 @@ use Composer\Repository\RepositoryManager;
use Composer\Repository\WritableRepositoryInterface; use Composer\Repository\WritableRepositoryInterface;
use Composer\Installer; use Composer\Installer;
use Composer\IO\IOInterface; use Composer\IO\IOInterface;
use Composer\TestCase; use Composer\Test\TestCase;
class FactoryMock extends Factory class FactoryMock extends Factory
{ {

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Package\Archiver; namespace Composer\Test\Package\Archiver;
use Composer\Package\Archiver\ArchivableFilesFinder; use Composer\Package\Archiver\ArchivableFilesFinder;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Symfony\Component\Process\Process; use Symfony\Component\Process\Process;

View file

@ -12,7 +12,7 @@
namespace Composer\Test\Package\Archiver; namespace Composer\Test\Package\Archiver;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\Util\ProcessExecutor; use Composer\Util\ProcessExecutor;
use Composer\Package\Package; use Composer\Package\Package;

View file

@ -14,7 +14,7 @@ namespace Composer\Test\Package;
use Composer\Package\Package; use Composer\Package\Package;
use Composer\Semver\VersionParser; use Composer\Semver\VersionParser;
use Composer\TestCase; use Composer\Test\TestCase;
class CompletePackageTest extends TestCase class CompletePackageTest extends TestCase
{ {

View file

@ -14,7 +14,7 @@ namespace Composer\Test\Package;
use Composer\Package\Link; use Composer\Package\Link;
use Composer\Package\RootAliasPackage; use Composer\Package\RootAliasPackage;
use Composer\TestCase; use Composer\Test\TestCase;
use Prophecy\Argument; use Prophecy\Argument;
class RootAliasPackageTest extends TestCase class RootAliasPackageTest extends TestCase

View file

@ -10,7 +10,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Composer\Test\Installer; namespace Composer\Test\Plugin;
use Composer\Composer; use Composer\Composer;
use Composer\Config; use Composer\Config;
@ -20,7 +20,7 @@ use Composer\Package\Loader\JsonLoader;
use Composer\Package\Loader\ArrayLoader; use Composer\Package\Loader\ArrayLoader;
use Composer\Plugin\PluginManager; use Composer\Plugin\PluginManager;
use Composer\Autoload\AutoloadGenerator; use Composer\Autoload\AutoloadGenerator;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
class PluginInstallerTest extends TestCase class PluginInstallerTest extends TestCase

View file

@ -10,7 +10,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Composer\Question\Test; namespace Composer\Test\Question;
use Composer\Question\StrictConfirmationQuestion; use Composer\Question\StrictConfirmationQuestion;
use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestCase;

View file

@ -14,7 +14,7 @@ namespace Composer\Test\Repository;
use Composer\Repository\ArrayRepository; use Composer\Repository\ArrayRepository;
use Composer\Repository\RepositoryInterface; use Composer\Repository\RepositoryInterface;
use Composer\TestCase; use Composer\Test\TestCase;
class ArrayRepositoryTest extends TestCase class ArrayRepositoryTest extends TestCase
{ {

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Repository; namespace Composer\Test\Repository;
use Composer\Repository\ArtifactRepository; use Composer\Repository\ArtifactRepository;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\IO\NullIO; use Composer\IO\NullIO;
use Composer\Config; use Composer\Config;
use Composer\Package\BasePackage; use Composer\Package\BasePackage;
@ -42,7 +42,7 @@ class ArtifactRepositoryTest extends TestCase
); );
$coordinates = array('type' => 'artifact', 'url' => __DIR__ . '/Fixtures/artifacts'); $coordinates = array('type' => 'artifact', 'url' => __DIR__ . '/Fixtures/artifacts');
$repo = new ArtifactRepository($coordinates, new NullIO(), new Config()); $repo = new ArtifactRepository($coordinates, new NullIO());
$foundPackages = array_map(function (BasePackage $package) { $foundPackages = array_map(function (BasePackage $package) {
return "{$package->getPrettyName()}-{$package->getPrettyVersion()}"; return "{$package->getPrettyName()}-{$package->getPrettyVersion()}";
@ -58,7 +58,7 @@ class ArtifactRepositoryTest extends TestCase
{ {
$absolutePath = __DIR__ . '/Fixtures/artifacts'; $absolutePath = __DIR__ . '/Fixtures/artifacts';
$coordinates = array('type' => 'artifact', 'url' => $absolutePath); $coordinates = array('type' => 'artifact', 'url' => $absolutePath);
$repo = new ArtifactRepository($coordinates, new NullIO(), new Config()); $repo = new ArtifactRepository($coordinates, new NullIO());
foreach ($repo->getPackages() as $package) { foreach ($repo->getPackages() as $package) {
$this->assertSame(strpos($package->getDistUrl(), strtr($absolutePath, '\\', '/')), 0); $this->assertSame(strpos($package->getDistUrl(), strtr($absolutePath, '\\', '/')), 0);
@ -69,7 +69,7 @@ class ArtifactRepositoryTest extends TestCase
{ {
$relativePath = 'tests/Composer/Test/Repository/Fixtures/artifacts'; $relativePath = 'tests/Composer/Test/Repository/Fixtures/artifacts';
$coordinates = array('type' => 'artifact', 'url' => $relativePath); $coordinates = array('type' => 'artifact', 'url' => $relativePath);
$repo = new ArtifactRepository($coordinates, new NullIO(), new Config()); $repo = new ArtifactRepository($coordinates, new NullIO());
foreach ($repo->getPackages() as $package) { foreach ($repo->getPackages() as $package) {
$this->assertSame(strpos($package->getDistUrl(), $relativePath), 0); $this->assertSame(strpos($package->getDistUrl(), $relativePath), 0);

View file

@ -16,7 +16,7 @@ use Composer\IO\NullIO;
use Composer\Repository\ComposerRepository; use Composer\Repository\ComposerRepository;
use Composer\Repository\RepositoryInterface; use Composer\Repository\RepositoryInterface;
use Composer\Test\Mock\FactoryMock; use Composer\Test\Mock\FactoryMock;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Package\Loader\ArrayLoader; use Composer\Package\Loader\ArrayLoader;
use Composer\Semver\VersionParser; use Composer\Semver\VersionParser;

View file

@ -14,7 +14,7 @@ namespace Composer\Test\Repository;
use Composer\Repository\CompositeRepository; use Composer\Repository\CompositeRepository;
use Composer\Repository\ArrayRepository; use Composer\Repository\ArrayRepository;
use Composer\TestCase; use Composer\Test\TestCase;
class CompositeRepositoryTest extends TestCase class CompositeRepositoryTest extends TestCase
{ {

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Repository; namespace Composer\Test\Repository;
use Composer\Repository\FilesystemRepository; use Composer\Repository\FilesystemRepository;
use Composer\TestCase; use Composer\Test\TestCase;
class FilesystemRepositoryTest extends TestCase class FilesystemRepositoryTest extends TestCase
{ {

View file

@ -15,7 +15,7 @@ namespace Composer\Test\Repository;
use Composer\Package\Loader\ArrayLoader; use Composer\Package\Loader\ArrayLoader;
use Composer\Repository\PathRepository; use Composer\Repository\PathRepository;
use Composer\Semver\VersionParser; use Composer\Semver\VersionParser;
use Composer\TestCase; use Composer\Test\TestCase;
class PathRepositoryTest extends TestCase class PathRepositoryTest extends TestCase
{ {
@ -25,11 +25,10 @@ class PathRepositoryTest extends TestCase
->getMock(); ->getMock();
$config = new \Composer\Config(); $config = new \Composer\Config();
$loader = new ArrayLoader(new VersionParser());
$versionGuesser = null; $versionGuesser = null;
$repositoryUrl = implode(DIRECTORY_SEPARATOR, array(__DIR__, 'Fixtures', 'path', 'with-version')); $repositoryUrl = implode(DIRECTORY_SEPARATOR, array(__DIR__, 'Fixtures', 'path', 'with-version'));
$repository = new PathRepository(array('url' => $repositoryUrl), $ioInterface, $config, $loader); $repository = new PathRepository(array('url' => $repositoryUrl), $ioInterface, $config);
$repository->getPackages(); $repository->getPackages();
$this->assertEquals(1, $repository->count()); $this->assertEquals(1, $repository->count());
@ -42,11 +41,10 @@ class PathRepositoryTest extends TestCase
->getMock(); ->getMock();
$config = new \Composer\Config(); $config = new \Composer\Config();
$loader = new ArrayLoader(new VersionParser());
$versionGuesser = null; $versionGuesser = null;
$repositoryUrl = implode(DIRECTORY_SEPARATOR, array(__DIR__, 'Fixtures', 'path', 'without-version')); $repositoryUrl = implode(DIRECTORY_SEPARATOR, array(__DIR__, 'Fixtures', 'path', 'without-version'));
$repository = new PathRepository(array('url' => $repositoryUrl), $ioInterface, $config, $loader); $repository = new PathRepository(array('url' => $repositoryUrl), $ioInterface, $config);
$packages = $repository->getPackages(); $packages = $repository->getPackages();
$this->assertEquals(1, $repository->count()); $this->assertEquals(1, $repository->count());
@ -64,11 +62,10 @@ class PathRepositoryTest extends TestCase
->getMock(); ->getMock();
$config = new \Composer\Config(); $config = new \Composer\Config();
$loader = new ArrayLoader(new VersionParser());
$versionGuesser = null; $versionGuesser = null;
$repositoryUrl = implode(DIRECTORY_SEPARATOR, array(__DIR__, 'Fixtures', 'path', '*')); $repositoryUrl = implode(DIRECTORY_SEPARATOR, array(__DIR__, 'Fixtures', 'path', '*'));
$repository = new PathRepository(array('url' => $repositoryUrl), $ioInterface, $config, $loader); $repository = new PathRepository(array('url' => $repositoryUrl), $ioInterface, $config);
$packages = $repository->getPackages(); $packages = $repository->getPackages();
$names = array(); $names = array();
@ -93,7 +90,6 @@ class PathRepositoryTest extends TestCase
->getMock(); ->getMock();
$config = new \Composer\Config(); $config = new \Composer\Config();
$loader = new ArrayLoader(new VersionParser());
$versionGuesser = null; $versionGuesser = null;
// realpath() does not fully expand the paths // realpath() does not fully expand the paths
@ -103,7 +99,7 @@ class PathRepositoryTest extends TestCase
// PHP Bug https://bugs.php.net/bug.php?id=73797 // PHP Bug https://bugs.php.net/bug.php?id=73797
$relativeUrl = ltrim(substr($repositoryUrl, strlen(realpath(realpath(getcwd())))), DIRECTORY_SEPARATOR); $relativeUrl = ltrim(substr($repositoryUrl, strlen(realpath(realpath(getcwd())))), DIRECTORY_SEPARATOR);
$repository = new PathRepository(array('url' => $relativeUrl), $ioInterface, $config, $loader); $repository = new PathRepository(array('url' => $relativeUrl), $ioInterface, $config);
$packages = $repository->getPackages(); $packages = $repository->getPackages();
$this->assertEquals(1, $repository->count()); $this->assertEquals(1, $repository->count());

View file

@ -17,7 +17,7 @@ use Composer\Repository\Pear\DependencyConstraint;
use Composer\Repository\Pear\DependencyInfo; use Composer\Repository\Pear\DependencyInfo;
use Composer\Repository\Pear\PackageInfo; use Composer\Repository\Pear\PackageInfo;
use Composer\Repository\Pear\ReleaseInfo; use Composer\Repository\Pear\ReleaseInfo;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Semver\VersionParser; use Composer\Semver\VersionParser;
use Composer\Semver\Constraint\Constraint; use Composer\Semver\Constraint\Constraint;
use Composer\Package\Link; use Composer\Package\Link;

View file

@ -12,7 +12,7 @@
namespace Composer\Test\Repository\Pear; namespace Composer\Test\Repository\Pear;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Test\Mock\RemoteFilesystemMock; use Composer\Test\Mock\RemoteFilesystemMock;
class ChannelRest10ReaderTest extends TestCase class ChannelRest10ReaderTest extends TestCase
@ -31,7 +31,7 @@ class ChannelRest10ReaderTest extends TestCase
$reader = new \Composer\Repository\Pear\ChannelRest10Reader($rfs); $reader = new \Composer\Repository\Pear\ChannelRest10Reader($rfs);
/** @var $packages \Composer\Package\PackageInterface[] */ /** @var \Composer\Package\PackageInterface[] $packages */
$packages = $reader->read('http://test.loc/rest10'); $packages = $reader->read('http://test.loc/rest10');
$this->assertCount(2, $packages); $this->assertCount(2, $packages);

View file

@ -12,7 +12,7 @@
namespace Composer\Test\Repository\Pear; namespace Composer\Test\Repository\Pear;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Test\Mock\RemoteFilesystemMock; use Composer\Test\Mock\RemoteFilesystemMock;
class ChannelRest11ReaderTest extends TestCase class ChannelRest11ReaderTest extends TestCase
@ -27,7 +27,7 @@ class ChannelRest11ReaderTest extends TestCase
$reader = new \Composer\Repository\Pear\ChannelRest11Reader($rfs); $reader = new \Composer\Repository\Pear\ChannelRest11Reader($rfs);
/** @var $packages \Composer\Package\PackageInterface[] */ /** @var \Composer\Package\PackageInterface[] $packages */
$packages = $reader->read('http://test.loc/rest11'); $packages = $reader->read('http://test.loc/rest11');
$this->assertCount(3, $packages); $this->assertCount(3, $packages);

View file

@ -14,7 +14,7 @@ namespace Composer\Test\Repository\Pear;
use Composer\Repository\Pear\DependencyConstraint; use Composer\Repository\Pear\DependencyConstraint;
use Composer\Repository\Pear\PackageDependencyParser; use Composer\Repository\Pear\PackageDependencyParser;
use Composer\TestCase; use Composer\Test\TestCase;
class PackageDependencyParserTest extends TestCase class PackageDependencyParserTest extends TestCase
{ {

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Repository; namespace Composer\Test\Repository;
use Composer\Repository\PearRepository; use Composer\Repository\PearRepository;
use Composer\TestCase; use Composer\Test\TestCase;
/** /**
* @group legacy * @group legacy

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Repository; namespace Composer\Test\Repository;
use Composer\Repository\RepositoryFactory; use Composer\Repository\RepositoryFactory;
use Composer\TestCase; use Composer\Test\TestCase;
class RepositoryFactoryTest extends TestCase class RepositoryFactoryTest extends TestCase
{ {

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Repository; namespace Composer\Test\Repository;
use Composer\Repository\RepositoryManager; use Composer\Repository\RepositoryManager;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
class RepositoryManagerTest extends TestCase class RepositoryManagerTest extends TestCase

View file

@ -14,7 +14,7 @@ namespace Composer\Test\Repository\Vcs;
use Composer\Repository\Vcs\FossilDriver; use Composer\Repository\Vcs\FossilDriver;
use Composer\Config; use Composer\Config;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\Util\Platform; use Composer\Util\Platform;

View file

@ -14,7 +14,7 @@ namespace Composer\Test\Repository\Vcs;
use Composer\Config; use Composer\Config;
use Composer\Repository\Vcs\GitBitbucketDriver; use Composer\Repository\Vcs\GitBitbucketDriver;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
/** /**

View file

@ -14,7 +14,7 @@ namespace Composer\Test\Repository\Vcs;
use Composer\Downloader\TransportException; use Composer\Downloader\TransportException;
use Composer\Repository\Vcs\GitHubDriver; use Composer\Repository\Vcs\GitHubDriver;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\Config; use Composer\Config;

View file

@ -14,7 +14,7 @@ namespace Composer\Test\Repository\Vcs;
use Composer\Repository\Vcs\GitLabDriver; use Composer\Repository\Vcs\GitLabDriver;
use Composer\Config; use Composer\Config;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Prophecy\Argument; use Prophecy\Argument;
@ -251,7 +251,7 @@ JSON;
public function testGetSource_GivenPublicProject() public function testGetSource_GivenPublicProject()
{ {
$driver = $this->testInitializePublicProject('https://gitlab.com/mygroup/myproject', 'https://gitlab.com/api/v4/projects/mygroup%2Fmyproject', true); $driver = $this->testInitializePublicProject('https://gitlab.com/mygroup/myproject', 'https://gitlab.com/api/v4/projects/mygroup%2Fmyproject');
$reference = 'c3ebdbf9cceddb82cd2089aaef8c7b992e536363'; $reference = 'c3ebdbf9cceddb82cd2089aaef8c7b992e536363';
$expected = array( $expected = array(

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Repository\Vcs; namespace Composer\Test\Repository\Vcs;
use Composer\Repository\Vcs\HgDriver; use Composer\Repository\Vcs\HgDriver;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\Config; use Composer\Config;

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Repository\Vcs; namespace Composer\Test\Repository\Vcs;
use Composer\Repository\Vcs\PerforceDriver; use Composer\Repository\Vcs\PerforceDriver;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\Config; use Composer\Config;
use Composer\Util\Perforce; use Composer\Util\Perforce;

View file

@ -14,7 +14,7 @@ namespace Composer\Test\Repository\Vcs;
use Composer\Repository\Vcs\SvnDriver; use Composer\Repository\Vcs\SvnDriver;
use Composer\Config; use Composer\Config;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\Util\Platform; use Composer\Util\Platform;

View file

@ -12,7 +12,7 @@
namespace Composer\Test\Repository; namespace Composer\Test\Repository;
use Composer\TestCase; use Composer\Test\TestCase;
use Symfony\Component\Process\ExecutableFinder; use Symfony\Component\Process\ExecutableFinder;
use Composer\Package\Dumper\ArrayDumper; use Composer\Package\Dumper\ArrayDumper;
use Composer\Repository\VcsRepository; use Composer\Repository\VcsRepository;

View file

@ -10,7 +10,7 @@
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Composer; namespace Composer\Test;
use Composer\Semver\VersionParser; use Composer\Semver\VersionParser;
use Composer\Package\AliasPackage; use Composer\Package\AliasPackage;

View file

@ -14,7 +14,7 @@ namespace Composer\Test\Util;
use Composer\IO\NullIO; use Composer\IO\NullIO;
use Composer\Util\ConfigValidator; use Composer\Util\ConfigValidator;
use Composer\TestCase; use Composer\Test\TestCase;
/** /**
* ConfigValidator test case * ConfigValidator test case

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Util; namespace Composer\Test\Util;
use Composer\Util\ErrorHandler; use Composer\Util\ErrorHandler;
use Composer\TestCase; use Composer\Test\TestCase;
/** /**
* ErrorHandler test case * ErrorHandler test case

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Util; namespace Composer\Test\Util;
use Composer\Util\Filesystem; use Composer\Util\Filesystem;
use Composer\TestCase; use Composer\Test\TestCase;
class FilesystemTest extends TestCase class FilesystemTest extends TestCase
{ {

View file

@ -13,7 +13,7 @@
namespace Composer\Test\Util; namespace Composer\Test\Util;
use Composer\Util\ProcessExecutor; use Composer\Util\ProcessExecutor;
use Composer\TestCase; use Composer\Test\TestCase;
use Composer\IO\BufferIO; use Composer\IO\BufferIO;
use Symfony\Component\Console\Output\StreamOutput; use Symfony\Component\Console\Output\StreamOutput;

View file

@ -17,4 +17,4 @@ if (function_exists('date_default_timezone_set') && function_exists('date_defaul
} }
require __DIR__.'/../src/bootstrap.php'; require __DIR__.'/../src/bootstrap.php';
require __DIR__.'/Composer/TestCase.php'; require __DIR__.'/Composer/Test/TestCase.php';