Fix tests and invalid use statements
parent
3da43e751d
commit
c6321e7277
|
@ -12,6 +12,8 @@
|
||||||
|
|
||||||
namespace Composer\DependencyResolver;
|
namespace Composer\DependencyResolver;
|
||||||
|
|
||||||
|
use Composer\Package\PackageInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nils Adermann <naderman@naderman.de>
|
* @author Nils Adermann <naderman@naderman.de>
|
||||||
*/
|
*/
|
||||||
|
@ -19,7 +21,7 @@ class Literal
|
||||||
{
|
{
|
||||||
protected $wanted;
|
protected $wanted;
|
||||||
|
|
||||||
public function __construct(Package $package, $wanted)
|
public function __construct(PackageInterface $package, $wanted)
|
||||||
{
|
{
|
||||||
$this->package = $package;
|
$this->package = $package;
|
||||||
$this->wanted = $wanted;
|
$this->wanted = $wanted;
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
namespace Composer\DependencyResolver;
|
namespace Composer\DependencyResolver;
|
||||||
|
|
||||||
use Composer\DependencyResolver\RelationConstraint\RelationConstraintInterface;
|
use Composer\DependencyResolver\RelationConstraint\RelationConstraintInterface;
|
||||||
|
use Composer\Repository\RepositoryInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A package pool contains repositories that provide packages.
|
* A package pool contains repositories that provide packages.
|
||||||
|
@ -35,13 +36,9 @@ class Pool
|
||||||
$this->repositories[] = $repo;
|
$this->repositories[] = $repo;
|
||||||
|
|
||||||
foreach ($repo->getPackages() as $package) {
|
foreach ($repo->getPackages() as $package) {
|
||||||
$this->packages[$package->getId()] = $package;
|
$this->packages[] = $package;
|
||||||
|
|
||||||
foreach ($package->getNames() as $name) {
|
foreach ($package->getNames() as $name) {
|
||||||
if (!isset($this->packageByName[$name])) {
|
|
||||||
$this->packageByNameByName[$name] = array();
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->packageByName[$name][] = $package;
|
$this->packageByName[$name][] = $package;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
namespace Composer\Package;
|
namespace Composer\Package;
|
||||||
|
|
||||||
use Composer\DependencyResolver\RelationConstraint\RelationConstraintInterface;
|
use Composer\DependencyResolver\RelationConstraint\RelationConstraintInterface;
|
||||||
use Composer\DependencyResolver\RepositoryInterface;
|
use Composer\Repository\RepositoryInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for packages providing name storage and default match implementation
|
* Base class for packages providing name storage and default match implementation
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
namespace Composer\Package;
|
namespace Composer\Package;
|
||||||
|
|
||||||
use Composer\DependencyResolver\RelationConstraint\RelationConstraintInterface;
|
use Composer\DependencyResolver\RelationConstraint\RelationConstraintInterface;
|
||||||
use Composer\DependencyResolver\RepositoryInterface;
|
use Composer\Repository\RepositoryInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nils Adermann <naderman@naderman.de>
|
* @author Nils Adermann <naderman@naderman.de>
|
||||||
|
@ -59,14 +59,14 @@ interface PackageInterface
|
||||||
*
|
*
|
||||||
* @return string The repository type
|
* @return string The repository type
|
||||||
*/
|
*/
|
||||||
function getRepositoryType();
|
function getSourceType();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the repository url of this package, e.g. git://github.com/naderman/composer.git
|
* Returns the repository url of this package, e.g. git://github.com/naderman/composer.git
|
||||||
*
|
*
|
||||||
* @return string The repository url
|
* @return string The repository url
|
||||||
*/
|
*/
|
||||||
function getRepositoryUrl();
|
function getSourceUrl();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the release type of this package, e.g. stable or beta
|
* Returns the release type of this package, e.g. stable or beta
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
namespace Composer\Test\DependencyResolver;
|
namespace Composer\Test\DependencyResolver;
|
||||||
|
|
||||||
use Composer\DependencyResolver\Literal;
|
use Composer\DependencyResolver\Literal;
|
||||||
use Composer\DependencyResolver\MemoryPackage;
|
use Composer\Package\MemoryPackage;
|
||||||
|
|
||||||
class SolvableTest extends \PHPUnit_Framework_TestCase
|
class SolvableTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
namespace Composer\Test\DependencyResolver;
|
namespace Composer\Test\DependencyResolver;
|
||||||
|
|
||||||
use Composer\DependencyResolver\Pool;
|
use Composer\DependencyResolver\Pool;
|
||||||
use Composer\DependencyResolver\ArrayRepository;
|
use Composer\Repository\ArrayRepository;
|
||||||
use Composer\DependencyResolver\MemoryPackage;
|
use Composer\Package\MemoryPackage;
|
||||||
|
|
||||||
class PoolTest extends \PHPUnit_Framework_TestCase
|
class PoolTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,9 +14,9 @@ namespace Composer\Test\DependencyResolver;
|
||||||
|
|
||||||
use Composer\DependencyResolver\Request;
|
use Composer\DependencyResolver\Request;
|
||||||
use Composer\DependencyResolver\Pool;
|
use Composer\DependencyResolver\Pool;
|
||||||
use Composer\DependencyResolver\ArrayRepository;
|
use Composer\Repository\ArrayRepository;
|
||||||
use Composer\DependencyResolver\Literal;
|
use Composer\DependencyResolver\Literal;
|
||||||
use Composer\DependencyResolver\MemoryPackage;
|
use Composer\Package\MemoryPackage;
|
||||||
|
|
||||||
class RequestTest extends \PHPUnit_Framework_TestCase
|
class RequestTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,20 +10,19 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Composer\Test\DependencyResolver;
|
namespace Composer\Test\Package;
|
||||||
|
|
||||||
use Composer\DependencyResolver\MemoryPackage;
|
use Composer\Package\MemoryPackage;
|
||||||
|
|
||||||
class PackageTest extends \PHPUnit_Framework_TestCase
|
class PackageTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
public function testPackage()
|
public function testPackage()
|
||||||
{
|
{
|
||||||
$package = new MemoryPackage('foo', '1', 'beta', 21);
|
$package = new MemoryPackage('foo', '1', 'beta');
|
||||||
|
|
||||||
$this->assertEquals('foo', $package->getName());
|
$this->assertEquals('foo', $package->getName());
|
||||||
$this->assertEquals('1', $package->getVersion());
|
$this->assertEquals('1', $package->getVersion());
|
||||||
$this->assertEquals('beta', $package->getReleaseType());
|
$this->assertEquals('beta', $package->getReleaseType());
|
||||||
$this->assertEquals(21, $package->getId());
|
|
||||||
|
|
||||||
$this->assertEquals('foo-beta-1', (string) $package);
|
$this->assertEquals('foo-beta-1', (string) $package);
|
||||||
}
|
}
|
|
@ -10,10 +10,10 @@
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Composer\Test\DependencyResolver;
|
namespace Composer\Test\Repository;
|
||||||
|
|
||||||
use Composer\DependencyResolver\ArrayRepository;
|
use Composer\Repository\ArrayRepository;
|
||||||
use Composer\DependencyResolver\MemoryPackage;
|
use Composer\Package\MemoryPackage;
|
||||||
|
|
||||||
class ArrayRepositoryTest extends \PHPUnit_Framework_TestCase
|
class ArrayRepositoryTest extends \PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
Loading…
Reference in New Issue