Throw exception if the local repository does not contain a package to uninstall
parent
af1f5a3423
commit
b1c4eed57f
|
@ -116,8 +116,6 @@ class LibraryInstaller implements InstallerInterface
|
|||
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
|
||||
{
|
||||
if (!$repo->hasPackage($package)) {
|
||||
// TODO throw exception again here, when update is fixed and we don't have to remove+install (see #125)
|
||||
return;
|
||||
throw new \InvalidArgumentException('Package is not installed: '.$package);
|
||||
}
|
||||
|
||||
|
|
|
@ -65,8 +65,6 @@ class MetapackageInstaller implements InstallerInterface
|
|||
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
|
||||
{
|
||||
if (!$repo->hasPackage($package)) {
|
||||
// TODO throw exception again here, when update is fixed and we don't have to remove+install (see #125)
|
||||
return;
|
||||
throw new \InvalidArgumentException('Package is not installed: '.$package);
|
||||
}
|
||||
|
||||
|
|
|
@ -71,8 +71,6 @@ class NoopInstaller implements InstallerInterface
|
|||
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
|
||||
{
|
||||
if (!$repo->hasPackage($package)) {
|
||||
// TODO throw exception again here, when update is fixed and we don't have to remove+install (see #125)
|
||||
return;
|
||||
throw new \InvalidArgumentException('Package is not installed: '.$package);
|
||||
}
|
||||
$repo->removePackage($package);
|
||||
|
|
|
@ -197,8 +197,7 @@ class LibraryInstallerTest extends TestCase
|
|||
|
||||
$library->uninstall($this->repository, $package);
|
||||
|
||||
// TODO re-enable once #125 is fixed and we throw exceptions again
|
||||
// $this->setExpectedException('InvalidArgumentException');
|
||||
$this->setExpectedException('InvalidArgumentException');
|
||||
|
||||
$library->uninstall($this->repository, $package);
|
||||
}
|
||||
|
|
|
@ -86,8 +86,7 @@ class MetapackageInstallerTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
$this->installer->uninstall($this->repository, $package);
|
||||
|
||||
// TODO re-enable once #125 is fixed and we throw exceptions again
|
||||
// $this->setExpectedException('InvalidArgumentException');
|
||||
$this->setExpectedException('InvalidArgumentException');
|
||||
|
||||
$this->installer->uninstall($this->repository, $package);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue