1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

Installer now provides full download path to the downloader

This commit is contained in:
everzet 2011-09-24 01:30:17 +03:00
parent 45cab9fe8c
commit 0a2f4e7e32
2 changed files with 21 additions and 6 deletions

View file

@ -110,10 +110,15 @@ class LibraryInstallerTest extends \PHPUnit_Framework_TestCase
$library = new LibraryInstaller($this->dir, $this->dm, $this->registry);
$package = $this->createPackageMock();
$package
->expects($this->once())
->method('getName')
->will($this->returnValue('some/package'));
$this->dm
->expects($this->once())
->method('download')
->with($package, $this->dir)
->with($package, $this->dir.'/some/package')
->will($this->returnValue('source'));
$this->registry
@ -130,6 +135,11 @@ class LibraryInstallerTest extends \PHPUnit_Framework_TestCase
$initial = $this->createPackageMock();
$target = $this->createPackageMock();
$initial
->expects($this->once())
->method('getName')
->will($this->returnValue('package1'));
$this->registry
->expects($this->exactly(2))
->method('isPackageRegistered')
@ -145,7 +155,7 @@ class LibraryInstallerTest extends \PHPUnit_Framework_TestCase
$this->dm
->expects($this->once())
->method('update')
->with($initial, $target, $this->dir, 'dist');
->with($initial, $target, $this->dir.'/package1', 'dist');
$this->registry
->expects($this->once())
@ -169,6 +179,11 @@ class LibraryInstallerTest extends \PHPUnit_Framework_TestCase
$library = new LibraryInstaller($this->dir, $this->dm, $this->registry);
$package = $this->createPackageMock();
$package
->expects($this->once())
->method('getName')
->will($this->returnValue('pkg'));
$this->registry
->expects($this->exactly(2))
->method('isPackageRegistered')
@ -184,7 +199,7 @@ class LibraryInstallerTest extends \PHPUnit_Framework_TestCase
$this->dm
->expects($this->once())
->method('remove')
->with($package, $this->dir, 'source');
->with($package, $this->dir.'/pkg', 'source');
$this->registry
->expects($this->once())