Create an impossible rule when trying to install something that doesn't exist.
The rule isn't acted upon yet (hence the incomplete test) but it is there as a reminder that this case needs to be handled.pull/324/head
parent
c97a33577b
commit
eafe13d5a5
|
@ -964,6 +964,12 @@ class Solver
|
||||||
|
|
||||||
|
|
||||||
foreach ($this->jobs as $job) {
|
foreach ($this->jobs as $job) {
|
||||||
|
if (empty($job['packages']) && $job['cmd'] == 'install') {
|
||||||
|
$this->addRule(
|
||||||
|
RuleSet::TYPE_JOB,
|
||||||
|
$this->createImpossibleRule(static::RULE_JOB_INSTALL, $job)
|
||||||
|
);
|
||||||
|
}
|
||||||
foreach ($job['packages'] as $package) {
|
foreach ($job['packages'] as $package) {
|
||||||
switch ($job['cmd']) {
|
switch ($job['cmd']) {
|
||||||
case 'install':
|
case 'install':
|
||||||
|
|
|
@ -55,6 +55,22 @@ class SolverTest extends TestCase
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testInstallNonExistingPackageFails()
|
||||||
|
{
|
||||||
|
$this->repo->addPackage($this->getPackage('A', '1.0'));
|
||||||
|
$this->reposComplete();
|
||||||
|
|
||||||
|
$this->request->install('B');
|
||||||
|
|
||||||
|
try {
|
||||||
|
$transaction = $this->solver->solve($this->request);
|
||||||
|
$this->markTestIncomplete('Reporting this failure is not implemented/working yet');
|
||||||
|
//$this->fail('Unsolvable conflict did not resolve in exception.');
|
||||||
|
} catch (SolverProblemsException $e) {
|
||||||
|
// @todo: assert problem properties
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function testSolverInstallWithDeps()
|
public function testSolverInstallWithDeps()
|
||||||
{
|
{
|
||||||
$this->repo->addPackage($packageA = $this->getPackage('A', '1.0'));
|
$this->repo->addPackage($packageA = $this->getPackage('A', '1.0'));
|
||||||
|
|
Loading…
Reference in New Issue