mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Rename findPackagesByName to findPackages and allow version arg
This commit is contained in:
parent
afbb9cefa4
commit
5eb333680b
7 changed files with 63 additions and 36 deletions
|
@ -51,18 +51,18 @@ class ArrayRepositoryTest extends TestCase
|
|||
$this->assertFalse($repo->hasPackage($this->getPackage('bar', '1')));
|
||||
}
|
||||
|
||||
public function testFindPackagesByName()
|
||||
public function testFindPackages()
|
||||
{
|
||||
$repo = new ArrayRepository();
|
||||
$repo->addPackage($this->getPackage('foo', '1'));
|
||||
$repo->addPackage($this->getPackage('bar', '2'));
|
||||
$repo->addPackage($this->getPackage('bar', '3'));
|
||||
|
||||
$foo = $repo->findPackagesByName('foo');
|
||||
$foo = $repo->findPackages('foo');
|
||||
$this->assertCount(1, $foo);
|
||||
$this->assertEquals('foo', $foo[0]->getName());
|
||||
|
||||
$bar = $repo->findPackagesByName('bar');
|
||||
$bar = $repo->findPackages('bar');
|
||||
$this->assertCount(2, $bar);
|
||||
$this->assertEquals('bar', $bar[0]->getName());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue