From 098ba8e58346f2891b9d7074bb7be6073b142c9d Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sun, 15 Jan 2012 14:15:53 +0100 Subject: [PATCH] Add test --- .../Test/DependencyResolver/SolverTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/Composer/Test/DependencyResolver/SolverTest.php b/tests/Composer/Test/DependencyResolver/SolverTest.php index c2ed0f2bf..7496834e6 100644 --- a/tests/Composer/Test/DependencyResolver/SolverTest.php +++ b/tests/Composer/Test/DependencyResolver/SolverTest.php @@ -115,6 +115,25 @@ class SolverTest extends TestCase $this->checkSolverResult(array()); } + public function testSolverUpdateDoesOnlyUpdate() + { + $this->repoInstalled->addPackage($packageA = $this->getPackage('A', '1.0')); + $this->repoInstalled->addPackage($packageB = $this->getPackage('B', '1.0')); + $this->repo->addPackage($newPackageB = $this->getPackage('B', '1.1')); + $this->reposComplete(); + + $packageA->setRequires(array(new Link('A', 'B', new VersionConstraint('>=', '1.0.0.0'), 'requires'))); + + $this->request->install('A', new VersionConstraint('=', '1.0.0.0')); + $this->request->install('B', new VersionConstraint('=', '1.1.0.0')); + $this->request->update('A', new VersionConstraint('=', '1.0.0.0')); + $this->request->update('B', new VersionConstraint('=', '1.0.0.0')); + + $this->checkSolverResult(array( + array('job' => 'update', 'from' => $packageB, 'to' => $newPackageB), + )); + } + public function testSolverUpdateSingle() { $this->repoInstalled->addPackage($packageA = $this->getPackage('A', '1.0'));