Skip to content
This repository was archived by the owner on May 2, 2023. It is now read-only.

Commit 9bb8597

Browse files
author
Lars Vierbergen
committed
Add extra tests
1 parent 06b4c98 commit 9bb8597

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

test.php

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,24 @@ function testComplexExpessions() {
146146
function testSatisfiedBy() {
147147
$t=array(
148148
'1.0.0'=>'1.0.0',
149-
'1.2.3'=>'1.2.3'
149+
'1.2.3'=>'1.2.3',
150+
'>=1.0.1'=>array('1.0.1','1.0.2','1.2.0','2.0.0'),
151+
'>=2'=>array('2.0.0','2.0.1','2.1.5','3.0.0'),
152+
'<=2.4'=>array('1.2.0','2.0.0','2.4.0'),
153+
'3.x'=>array('3.0.1','3.2.0','3.1.5'),
154+
'1.5.6 - 2.3.4'=>array('1.5.6','1.5.7','1.6.0','2.1.0','2.3.0','2.3.3'),
155+
'1 - 2 || >=2.0.5'=>array('1.0.0','2.1.0','1.4.0','1.0.2','3.0.4','2.0.6','3.0.0'),
156+
'>4.0.0 <=4.2.3'=>array('4.0.1','4.1.2','4.2.3','4.1.0')
150157
);
151-
foreach($t as $range=>$version) {
158+
foreach($t as $range=>$satisfies) {
152159
$e=new versionExpression($range);
153-
$v=new version($version);
154-
$this->assertTrue($e->satisfiedBy($v), '['.$range.' :: '.$version.'] %s');
160+
if(!is_array($satisfies)) {
161+
$satisfies=array($satisfies);
162+
}
163+
foreach($satisfies as $version) {
164+
$v=new version($version);
165+
$this->assertTrue($e->satisfiedBy($v), '['.$range.' :: '.$version.'] %s');
166+
}
155167
}
156168
}
157169
}

0 commit comments

Comments
 (0)