Skip to content

Commit

Permalink
Fix tests with php 7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
francoispluchino committed Dec 28, 2017
1 parent b547c8c commit c8225f7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Tests/Asset/AbstractAssetManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ public function testAddDependenciesForInstallCommand()
);
/* @var RootPackageInterface|\PHPUnit_Framework_MockObject_MockObject $rootPackage */
$rootPackage = $this->getMockBuilder('Composer\Package\RootPackageInterface')->getMock();
$rootPackage->expects($this->any())
->method('getLicense')
->willReturn(array());

$this->assertFalse($this->manager->isInstalled());
$this->assertFalse($this->manager->isUpdatable());
Expand Down Expand Up @@ -264,6 +267,9 @@ public function testAddDependenciesForUpdateCommand()
$jsonFile = new JsonFile($this->cwd.'/package.json');
/* @var RootPackageInterface|\PHPUnit_Framework_MockObject_MockObject $rootPackage */
$rootPackage = $this->getMockBuilder('Composer\Package\RootPackageInterface')->getMock();
$rootPackage->expects($this->any())
->method('getLicense')
->willReturn(array());
$nodeModulePath = $this->cwd.ltrim(AbstractAssetManager::NODE_MODULES_PATH, '.');

$jsonFile->write($package);
Expand Down
5 changes: 5 additions & 0 deletions Tests/Asset/AssetPackageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ protected function setUp()
->setMethods(array('exists', 'getPath', 'read', 'write'))
->getMock();

$this->rootPackage->expects($this->any())
->method('getLicense')
->willReturn(array());

$this->sfs->mkdir($this->cwd);
}

Expand Down Expand Up @@ -148,6 +152,7 @@ public function testInjectionOfRequiredKeys(array $expected, array $package, $li
{
$this->addPackageFile($package);

$this->rootPackage = $this->getMockBuilder('Composer\Package\RootPackageInterface')->getMock();
$this->rootPackage->expects($this->any())
->method('getLicense')
->willReturn(array($license));
Expand Down

0 comments on commit c8225f7

Please sign in to comment.