Merge pull request #8595 from IonBazan/risky-test

Fix risky test
main
Jordi Boggiano 4 years ago committed by GitHub
commit 0cc04f0fde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,13 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.7/phpunit.xsd"
backupGlobals="false" backupGlobals="false"
backupStaticAttributes="false" backupStaticAttributes="false"
beStrictAboutTestsThatDoNotTestAnything="true"
colors="true" colors="true"
convertErrorsToExceptions="true" convertErrorsToExceptions="true"
convertNoticesToExceptions="true" convertNoticesToExceptions="true"
convertWarningsToExceptions="true" convertWarningsToExceptions="true"
failOnRisky="true"
strict="false" strict="false"
processIsolation="false" processIsolation="false"
stopOnFailure="false" stopOnFailure="false"

@ -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,

Loading…
Cancel
Save