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

Remove RepositorySet from Solver and remove getPool from RepositorySet

This commit is contained in:
Jordi Boggiano 2020-01-30 15:23:22 +01:00
parent f982a10447
commit c41df325d8
No known key found for this signature in database
GPG key ID: 7BBD42C429EC80BC
10 changed files with 36 additions and 61 deletions

View file

@ -34,6 +34,7 @@ class SolverTest extends TestCase
protected $request;
protected $policy;
protected $solver;
protected $pool;
public function setUp()
{
@ -82,7 +83,7 @@ class SolverTest extends TestCase
$problems = $e->getProblems();
$this->assertCount(1, $problems);
$this->assertEquals(2, $e->getCode());
$this->assertEquals("\n - Root composer.json requires b, it could not be found in any version, there may be a typo in the package name.", $problems[0]->getPrettyString($this->repoSet, $this->request));
$this->assertEquals("\n - Root composer.json requires b, it could not be found in any version, there may be a typo in the package name.", $problems[0]->getPrettyString($this->repoSet, $this->request, $this->pool));
}
}
@ -653,7 +654,7 @@ class SolverTest extends TestCase
$msg .= " - Root composer.json requires a -> satisfiable by A[1.0].\n";
$msg .= " - B 1.0 conflicts with A[1.0].\n";
$msg .= " - Root composer.json requires b -> satisfiable by B[1.0].\n";
$this->assertEquals($msg, $e->getMessage());
$this->assertEquals($msg, $e->getPrettyString($this->repoSet, $this->request, $this->pool));
}
}
@ -683,7 +684,7 @@ class SolverTest extends TestCase
$msg .= " Problem 1\n";
$msg .= " - Root composer.json requires a -> satisfiable by A[1.0].\n";
$msg .= " - A 1.0 requires b >= 2.0 -> found B[1.0] but it does not match your constraint.\n";
$this->assertEquals($msg, $e->getMessage());
$this->assertEquals($msg, $e->getPrettyString($this->repoSet, $this->request, $this->pool));
}
}
@ -728,7 +729,7 @@ class SolverTest extends TestCase
$msg .= " - Only one of these can be installed: B[0.9, 1.0].\n";
$msg .= " - A 1.0 requires b >= 1.0 -> satisfiable by B[1.0].\n";
$msg .= " - Root composer.json requires a -> satisfiable by A[1.0].\n";
$this->assertEquals($msg, $e->getMessage());
$this->assertEquals($msg, $e->getPrettyString($this->repoSet, $this->request, $this->pool));
}
}
@ -889,7 +890,8 @@ class SolverTest extends TestCase
protected function createSolver()
{
$this->solver = new Solver($this->policy, $this->repoSet->createPool($this->request), new NullIO(), $this->repoSet);
$this->pool = $this->repoSet->createPool($this->request);
$this->solver = new Solver($this->policy, $this->pool, new NullIO());
}
protected function checkSolverResult(array $expected)