1
0
Fork 0
pull/2351/head
Jordi Boggiano 2013-10-19 17:59:33 +02:00
parent 4603e43712
commit f5df1d6a9b
1 changed files with 19 additions and 19 deletions

View File

@ -51,16 +51,16 @@ class PerforceDownloaderTest extends \PHPUnit_Framework_TestCase
array($repoConfig, $this->io, $this->config) array($repoConfig, $this->io, $this->config)
); );
$package->expects($this->at(0)) $package->expects($this->at(0))
->method('getSourceReference') ->method('getSourceReference')
->will($this->returnValue('SOURCE_REF')); ->will($this->returnValue('SOURCE_REF'));
$package->expects($this->at(1)) $package->expects($this->at(1))
->method('getPrettyVersion') ->method('getPrettyVersion')
->will($this->returnValue('100')); ->will($this->returnValue('100'));
$package->expects($this->at(2)) $package->expects($this->at(2))
->method('getRepository') ->method('getRepository')
->will($this->returnValue($repository)); ->will($this->returnValue($repository));
$repository->expects($this->at(0)) $repository->expects($this->at(0))
->method('getRepoConfig'); ->method('getRepoConfig');
$path = $this->testPath; $path = $this->testPath;
$downloader->doDownload($package, $path); $downloader->doDownload($package, $path);
} }
@ -80,26 +80,26 @@ class PerforceDownloaderTest extends \PHPUnit_Framework_TestCase
$ref = 'SOURCE_REF'; $ref = 'SOURCE_REF';
$label = 'LABEL'; $label = 'LABEL';
$perforce->expects($this->at(0)) $perforce->expects($this->at(0))
->method('setStream') ->method('setStream')
->with($this->equalTo($ref)); ->with($this->equalTo($ref));
$perforce->expects($this->at(1)) $perforce->expects($this->at(1))
->method('queryP4User') ->method('queryP4User')
->with($this->io); ->with($this->io);
$perforce->expects($this->at(2)) $perforce->expects($this->at(2))
->method('writeP4ClientSpec'); ->method('writeP4ClientSpec');
$perforce->expects($this->at(3)) $perforce->expects($this->at(3))
->method('connectClient'); ->method('connectClient');
$perforce->expects($this->at(4)) $perforce->expects($this->at(4))
->method('syncCodeBase') ->method('syncCodeBase')
->with($this->equalTo($label)); ->with($this->equalTo($label));
$downloader->setPerforce($perforce); $downloader->setPerforce($perforce);
$package = $this->getMock('Composer\Package\PackageInterface'); $package = $this->getMock('Composer\Package\PackageInterface');
$package->expects($this->at(0)) $package->expects($this->at(0))
->method('getSourceReference') ->method('getSourceReference')
->will($this->returnValue($ref)); ->will($this->returnValue($ref));
$package->expects($this->at(1)) $package->expects($this->at(1))
->method('getPrettyVersion') ->method('getPrettyVersion')
->will($this->returnValue($label)); ->will($this->returnValue($label));
$path = $this->testPath; $path = $this->testPath;
$downloader->doDownload($package, $path); $downloader->doDownload($package, $path);
} }