2012-03-09 18:30:37 +00:00
|
|
|
<?php
|
2013-05-27 08:41:50 +00:00
|
|
|
|
2012-03-09 18:30:37 +00:00
|
|
|
/*
|
|
|
|
* 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;
|
|
|
|
|
|
|
|
use Composer\Composer;
|
2013-09-25 08:14:42 +00:00
|
|
|
use Composer\TestCase;
|
2012-03-09 18:30:37 +00:00
|
|
|
|
|
|
|
class ComposerTest extends TestCase
|
|
|
|
{
|
|
|
|
public function testSetGetPackage()
|
|
|
|
{
|
|
|
|
$composer = new Composer();
|
2012-08-23 13:52:40 +00:00
|
|
|
$package = $this->getMock('Composer\Package\RootPackageInterface');
|
2012-03-09 18:30:37 +00:00
|
|
|
$composer->setPackage($package);
|
|
|
|
|
2012-03-10 08:53:03 +00:00
|
|
|
$this->assertSame($package, $composer->getPackage());
|
2012-03-09 18:30:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testSetGetLocker()
|
|
|
|
{
|
|
|
|
$composer = new Composer();
|
|
|
|
$locker = $this->getMockBuilder('Composer\Package\Locker')->disableOriginalConstructor()->getMock();
|
|
|
|
$composer->setLocker($locker);
|
|
|
|
|
2012-03-10 08:53:03 +00:00
|
|
|
$this->assertSame($locker, $composer->getLocker());
|
2012-03-09 18:30:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testSetGetRepositoryManager()
|
|
|
|
{
|
|
|
|
$composer = new Composer();
|
|
|
|
$manager = $this->getMockBuilder('Composer\Repository\RepositoryManager')->disableOriginalConstructor()->getMock();
|
|
|
|
$composer->setRepositoryManager($manager);
|
|
|
|
|
2012-03-10 08:53:03 +00:00
|
|
|
$this->assertSame($manager, $composer->getRepositoryManager());
|
2012-03-09 18:30:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testSetGetDownloadManager()
|
|
|
|
{
|
|
|
|
$composer = new Composer();
|
|
|
|
$manager = $this->getMock('Composer\Downloader\DownloadManager');
|
|
|
|
$composer->setDownloadManager($manager);
|
|
|
|
|
2012-03-10 08:53:03 +00:00
|
|
|
$this->assertSame($manager, $composer->getDownloadManager());
|
2012-03-09 18:30:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public function testSetGetInstallationManager()
|
|
|
|
{
|
|
|
|
$composer = new Composer();
|
|
|
|
$manager = $this->getMock('Composer\Installer\InstallationManager');
|
|
|
|
$composer->setInstallationManager($manager);
|
|
|
|
|
2012-03-10 08:53:03 +00:00
|
|
|
$this->assertSame($manager, $composer->getInstallationManager());
|
2012-03-09 18:30:37 +00:00
|
|
|
}
|
2012-06-14 10:10:01 +00:00
|
|
|
}
|