mirror of
https://github.com/composer/composer
synced 2025-05-09 08:32:56 +00:00
Re-install binaries on update/install
Binaries are re-installed after an update/install (ie: removed and then installed)
This commit is contained in:
parent
37a1e12672
commit
e9fc0e6548
14 changed files with 96 additions and 1 deletions
|
@ -255,6 +255,32 @@ class LibraryInstallerTest extends TestCase
|
|||
$this->assertEquals($this->vendorDir.'/'.$package->getPrettyName().'/Some/Namespace', $library->getInstallPath($package));
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testInstallerCreationShouldNotCreateVendorDirectory
|
||||
* @depends testInstallerCreationShouldNotCreateBinDirectory
|
||||
*/
|
||||
public function testInstallBinary()
|
||||
{
|
||||
$binaryInstallerMock = $this->getMockBuilder('Composer\Installer\BinaryInstaller')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$library = new LibraryInstaller($this->io, $this->composer, 'library', null, $binaryInstallerMock);
|
||||
$package = $this->createPackageMock();
|
||||
|
||||
$binaryInstallerMock
|
||||
->expects($this->once())
|
||||
->method('removeBinaries')
|
||||
->with($package);
|
||||
|
||||
$binaryInstallerMock
|
||||
->expects($this->once())
|
||||
->method('installBinaries')
|
||||
->with($package, $library->getInstallPath($package));
|
||||
|
||||
$library->installBinary($package);
|
||||
}
|
||||
|
||||
protected function createPackageMock()
|
||||
{
|
||||
return $this->getMockBuilder('Composer\Package\Package')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue