mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Settings of the same repository for a package is allowed.
This commit is contained in:
parent
02f92e678f
commit
fa0d62ab6a
3 changed files with 43 additions and 2 deletions
42
tests/Composer/Test/Package/BasePackageTest.php
Normal file
42
tests/Composer/Test/Package/BasePackageTest.php
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?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\Package;
|
||||
|
||||
use Composer\Package\BasePackage;
|
||||
|
||||
class BasePackageTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testSetSameRepository()
|
||||
{
|
||||
$package = $this->getMockForAbstractClass('Composer\Package\BasePackage', array('foo'));
|
||||
$repository = $this->getMock('Composer\Repository\RepositoryInterface');
|
||||
|
||||
$package->setRepository($repository);
|
||||
try {
|
||||
$package->setRepository($repository);
|
||||
} catch (\Exception $e) {
|
||||
$this->fail('Set againt the same repository is allowed.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException LogicException
|
||||
*/
|
||||
public function testSetAnotherRepository()
|
||||
{
|
||||
$package = $this->getMockForAbstractClass('Composer\Package\BasePackage', array('foo'));
|
||||
|
||||
$package->setRepository($this->getMock('Composer\Repository\RepositoryInterface'));
|
||||
$package->setRepository($this->getMock('Composer\Repository\RepositoryInterface'));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue