mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Fix strings being passed to an int arg, fixes 7.1 build
This commit is contained in:
parent
870dcece1f
commit
c74e6df65d
3 changed files with 28 additions and 18 deletions
|
@ -27,11 +27,11 @@ class RuleSetIteratorTest extends \PHPUnit_Framework_TestCase
|
|||
|
||||
$this->rules = array(
|
||||
RuleSet::TYPE_JOB => array(
|
||||
new Rule(array(), 'job1', null),
|
||||
new Rule(array(), 'job2', null),
|
||||
new Rule(array(), Rule::RULE_JOB_INSTALL, null),
|
||||
new Rule(array(), Rule::RULE_JOB_INSTALL, null),
|
||||
),
|
||||
RuleSet::TYPE_LEARNED => array(
|
||||
new Rule(array(), 'update1', null),
|
||||
new Rule(array(), Rule::RULE_INTERNAL_ALLOW_UPDATE, null),
|
||||
),
|
||||
RuleSet::TYPE_PACKAGE => array(),
|
||||
);
|
||||
|
|
|
@ -32,11 +32,11 @@ class RuleSetTest extends TestCase
|
|||
$rules = array(
|
||||
RuleSet::TYPE_PACKAGE => array(),
|
||||
RuleSet::TYPE_JOB => array(
|
||||
new Rule(array(), 'job1', null),
|
||||
new Rule(array(), 'job2', null),
|
||||
new Rule(array(), Rule::RULE_JOB_INSTALL, null),
|
||||
new Rule(array(), Rule::RULE_JOB_INSTALL, null),
|
||||
),
|
||||
RuleSet::TYPE_LEARNED => array(
|
||||
new Rule(array(), 'update1', null),
|
||||
new Rule(array(), Rule::RULE_INTERNAL_ALLOW_UPDATE, null),
|
||||
),
|
||||
);
|
||||
|
||||
|
@ -56,15 +56,15 @@ class RuleSetTest extends TestCase
|
|||
{
|
||||
$ruleSet = new RuleSet;
|
||||
|
||||
$ruleSet->add(new Rule(array(), 'job1', null), 7);
|
||||
$ruleSet->add(new Rule(array(), Rule::RULE_JOB_INSTALL, null), 7);
|
||||
}
|
||||
|
||||
public function testCount()
|
||||
{
|
||||
$ruleSet = new RuleSet;
|
||||
|
||||
$ruleSet->add(new Rule(array(), 'job1', null), RuleSet::TYPE_JOB);
|
||||
$ruleSet->add(new Rule(array(), 'job2', null), RuleSet::TYPE_JOB);
|
||||
$ruleSet->add(new Rule(array(), Rule::RULE_JOB_INSTALL, null), RuleSet::TYPE_JOB);
|
||||
$ruleSet->add(new Rule(array(), Rule::RULE_JOB_INSTALL, null), RuleSet::TYPE_JOB);
|
||||
|
||||
$this->assertEquals(2, $ruleSet->count());
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ class RuleSetTest extends TestCase
|
|||
{
|
||||
$ruleSet = new RuleSet;
|
||||
|
||||
$rule = new Rule(array(), 'job1', null);
|
||||
$rule = new Rule(array(), Rule::RULE_JOB_INSTALL, null);
|
||||
$ruleSet->add($rule, RuleSet::TYPE_JOB);
|
||||
|
||||
$this->assertSame($rule, $ruleSet->ruleById[0]);
|
||||
|
@ -83,8 +83,8 @@ class RuleSetTest extends TestCase
|
|||
{
|
||||
$ruleSet = new RuleSet;
|
||||
|
||||
$rule1 = new Rule(array(), 'job1', null);
|
||||
$rule2 = new Rule(array(), 'job1', null);
|
||||
$rule1 = new Rule(array(), Rule::RULE_JOB_INSTALL, null);
|
||||
$rule2 = new Rule(array(), Rule::RULE_JOB_INSTALL, null);
|
||||
$ruleSet->add($rule1, RuleSet::TYPE_JOB);
|
||||
$ruleSet->add($rule2, RuleSet::TYPE_LEARNED);
|
||||
|
||||
|
@ -98,8 +98,8 @@ class RuleSetTest extends TestCase
|
|||
public function testGetIteratorFor()
|
||||
{
|
||||
$ruleSet = new RuleSet;
|
||||
$rule1 = new Rule(array(), 'job1', null);
|
||||
$rule2 = new Rule(array(), 'job1', null);
|
||||
$rule1 = new Rule(array(), Rule::RULE_JOB_INSTALL, null);
|
||||
$rule2 = new Rule(array(), Rule::RULE_JOB_INSTALL, null);
|
||||
|
||||
$ruleSet->add($rule1, RuleSet::TYPE_JOB);
|
||||
$ruleSet->add($rule2, RuleSet::TYPE_LEARNED);
|
||||
|
@ -112,8 +112,8 @@ class RuleSetTest extends TestCase
|
|||
public function testGetIteratorWithout()
|
||||
{
|
||||
$ruleSet = new RuleSet;
|
||||
$rule1 = new Rule(array(), 'job1', null);
|
||||
$rule2 = new Rule(array(), 'job1', null);
|
||||
$rule1 = new Rule(array(), Rule::RULE_JOB_INSTALL, null);
|
||||
$rule2 = new Rule(array(), Rule::RULE_JOB_INSTALL, null);
|
||||
|
||||
$ruleSet->add($rule1, RuleSet::TYPE_JOB);
|
||||
$ruleSet->add($rule2, RuleSet::TYPE_LEARNED);
|
||||
|
@ -163,11 +163,11 @@ class RuleSetTest extends TestCase
|
|||
|
||||
$ruleSet = new RuleSet;
|
||||
$literal = $p->getId();
|
||||
$rule = new Rule(array($literal), 'job1', null);
|
||||
$rule = new Rule(array($literal), Rule::RULE_JOB_INSTALL, null);
|
||||
|
||||
$ruleSet->add($rule, RuleSet::TYPE_JOB);
|
||||
|
||||
$this->assertContains('JOB : (install foo 2.1)', $ruleSet->getPrettyString($this->pool));
|
||||
$this->assertContains('JOB : Install command rule (install foo 2.1)', $ruleSet->getPrettyString($this->pool));
|
||||
}
|
||||
|
||||
private function getRuleMock()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue