1
0
Fork 0

Merge pull request #1827 from pulse00/exitcode-patch

Return different error code for SolverProblemsException
pull/1825/merge
Jordi Boggiano 2013-04-25 07:42:30 -07:00
commit 028d95db63
2 changed files with 2 additions and 1 deletions

View File

@ -25,7 +25,7 @@ class SolverProblemsException extends \RuntimeException
$this->problems = $problems;
$this->installedMap = $installedMap;
parent::__construct($this->createMessage());
parent::__construct($this->createMessage(), 2);
}
protected function createMessage()

View File

@ -75,6 +75,7 @@ class SolverTest extends TestCase
} catch (SolverProblemsException $e) {
$problems = $e->getProblems();
$this->assertEquals(1, count($problems));
$this->assertEquals(2, $e->getCode());
$this->assertEquals("\n - The requested package b could not be found in any version, there may be a typo in the package name.", $problems[0]->getPrettyString());
}
}