1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- namespace Composer\Test;
- use Composer\Composer;
- use Composer\Test\TestCase;
- class ComposerTest extends TestCase
- {
- public function testSetGetPackage()
- {
- $composer = new Composer();
- $package = $this->getMockBuilder('Composer\Package\RootPackageInterface')->getMock();
- $composer->setPackage($package);
- $this->assertSame($package, $composer->getPackage());
- }
- public function testSetGetLocker()
- {
- $composer = new Composer();
- $locker = $this->getMockBuilder('Composer\Package\Locker')->disableOriginalConstructor()->getMock();
- $composer->setLocker($locker);
- $this->assertSame($locker, $composer->getLocker());
- }
- public function testSetGetRepositoryManager()
- {
- $composer = new Composer();
- $manager = $this->getMockBuilder('Composer\Repository\RepositoryManager')->disableOriginalConstructor()->getMock();
- $composer->setRepositoryManager($manager);
- $this->assertSame($manager, $composer->getRepositoryManager());
- }
- public function testSetGetDownloadManager()
- {
- $composer = new Composer();
- $io = $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
- $manager = $this->getMockBuilder('Composer\Downloader\DownloadManager')->setConstructorArgs(array($io))->getMock();
- $composer->setDownloadManager($manager);
- $this->assertSame($manager, $composer->getDownloadManager());
- }
- public function testSetGetInstallationManager()
- {
- $composer = new Composer();
- $manager = $this->getMockBuilder('Composer\Installer\InstallationManager')->disableOriginalConstructor()->getMock();
- $composer->setInstallationManager($manager);
- $this->assertSame($manager, $composer->getInstallationManager());
- }
- }
|