1
0
Fork 0

Merge pull request #8595 from IonBazan/risky-test

Fix risky test
pull/8597/head
Jordi Boggiano 2020-02-11 10:32:04 +01:00 committed by GitHub
commit 0cc04f0fde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 24 deletions

View File

@ -1,13 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<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"
backupStaticAttributes="false"
beStrictAboutTestsThatDoNotTestAnything="true"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
failOnRisky="true"
strict="false"
processIsolation="false"
stopOnFailure="false"

View File

@ -57,7 +57,7 @@ class ArchiveCommandTest extends TestCase
'isInteractive',
'getComposer',
))->getMock();
$command->expects($this->any())->method('getComposer')
$command->expects($this->atLeastOnce())->method('getComposer')
->willReturn($composer);
$command->method('isInteractive')->willReturn(false);
@ -70,26 +70,8 @@ class ArchiveCommandTest extends TestCase
$output = $this->getMockBuilder('Symfony\Component\Console\Output\OutputInterface')
->getMock();
$ed = $this->getMockBuilder('Composer\EventDispatcher\EventDispatcher')
->disableOriginalConstructor()->getMock();
$composer = new Composer;
$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')
->setMethods(array(
'mergeApplicationDefinition',
@ -100,11 +82,11 @@ class ArchiveCommandTest extends TestCase
'getComposer',
'archive',
))->getMock();
$command->expects($this->any())->method('getComposer')
->willReturnOnConsecutiveCalls(null, $composer);
$command->expects($this->any())->method('archive')
$command->expects($this->once())->method('getComposer')
->willReturn(null);
$command->expects($this->once())->method('archive')
->with(
$this->isType('object'),
$this->isInstanceOf('Composer\IO\IOInterface'),
$config,
null,
null,