Skip to content

Commit

Permalink
Fix mock methods with new version of phpunit
Browse files Browse the repository at this point in the history
  • Loading branch information
francoispluchino committed Apr 1, 2016
1 parent 58939d3 commit 7cf57ab
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Tests/Composer/ScriptHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,17 @@ protected function createEvent($composerType)
->method('getType')
->will($this->returnValue($composerType));

$this->operation->expects($this->any())
->method('getTargetPackage')
->will($this->returnValue($this->package));

$this->operation->expects($this->any())
->method('getPackage')
->will($this->returnValue($this->package));
if ($this->operation instanceof UpdateOperation) {
$this->operation->expects($this->any())
->method('getTargetPackage')
->will($this->returnValue($this->package));
}

if ($this->operation instanceof InstallOperation) {
$this->operation->expects($this->any())
->method('getPackage')
->will($this->returnValue($this->package));
}

/* @var PolicyInterface $policy */
$policy = $this->getMock('Composer\DependencyResolver\PolicyInterface');
Expand Down

0 comments on commit 7cf57ab

Please sign in to comment.