|
|
@ -57,7 +57,7 @@ class ArchiveCommandTest extends TestCase
|
|
|
|
'isInteractive',
|
|
|
|
'isInteractive',
|
|
|
|
'getComposer',
|
|
|
|
'getComposer',
|
|
|
|
))->getMock();
|
|
|
|
))->getMock();
|
|
|
|
$command->expects($this->any())->method('getComposer')
|
|
|
|
$command->expects($this->atLeastOnce())->method('getComposer')
|
|
|
|
->willReturn($composer);
|
|
|
|
->willReturn($composer);
|
|
|
|
$command->method('isInteractive')->willReturn(false);
|
|
|
|
$command->method('isInteractive')->willReturn(false);
|
|
|
|
|
|
|
|
|
|
|
@ -70,26 +70,8 @@ class ArchiveCommandTest extends TestCase
|
|
|
|
|
|
|
|
|
|
|
|
$output = $this->getMockBuilder('Symfony\Component\Console\Output\OutputInterface')
|
|
|
|
$output = $this->getMockBuilder('Symfony\Component\Console\Output\OutputInterface')
|
|
|
|
->getMock();
|
|
|
|
->getMock();
|
|
|
|
|
|
|
|
|
|
|
|
$ed = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
|
|
|
|
|
|
|
|
->disableOriginalConstructor()->getMock();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$composer = new Composer;
|
|
|
|
|
|
|
|
$config = Factory::createConfig();
|
|
|
|
$config = Factory::createConfig();
|
|
|
|
|
|
|
|
|
|
|
|
$manager = $this->getMockBuilder('Composer\Package\Archiver\ArchiveManager')
|
|
|
|
|
|
|
|
->disableOriginalConstructor()->getMock();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$factory = $this->getMockBuilder('Composer\Factory')->getMock();
|
|
|
|
|
|
|
|
$factory->method('createArchiveManager')->willReturn($manager);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$package = $this->getMockBuilder('Composer\Package\RootPackageInterface')
|
|
|
|
|
|
|
|
->getMock();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$composer->setArchiveManager($manager);
|
|
|
|
|
|
|
|
$composer->setEventDispatcher($ed);
|
|
|
|
|
|
|
|
$composer->setPackage($package);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$command = $this->getMockBuilder('Composer\Command\ArchiveCommand')
|
|
|
|
$command = $this->getMockBuilder('Composer\Command\ArchiveCommand')
|
|
|
|
->setMethods(array(
|
|
|
|
->setMethods(array(
|
|
|
|
'mergeApplicationDefinition',
|
|
|
|
'mergeApplicationDefinition',
|
|
|
@ -100,11 +82,11 @@ class ArchiveCommandTest extends TestCase
|
|
|
|
'getComposer',
|
|
|
|
'getComposer',
|
|
|
|
'archive',
|
|
|
|
'archive',
|
|
|
|
))->getMock();
|
|
|
|
))->getMock();
|
|
|
|
$command->expects($this->any())->method('getComposer')
|
|
|
|
$command->expects($this->once())->method('getComposer')
|
|
|
|
->willReturnOnConsecutiveCalls(null, $composer);
|
|
|
|
->willReturn(null);
|
|
|
|
$command->expects($this->any())->method('archive')
|
|
|
|
$command->expects($this->once())->method('archive')
|
|
|
|
->with(
|
|
|
|
->with(
|
|
|
|
$this->isType('object'),
|
|
|
|
$this->isInstanceOf('Composer\IO\IOInterface'),
|
|
|
|
$config,
|
|
|
|
$config,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|
null,
|
|
|
|