Skip to content

Commit 1402144

Browse files
committed
Update CompareTest.php
1 parent 5fe6c35 commit 1402144

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/CompareTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,24 @@ public function testLessThanByPreRelease()
2323
$this->assertTrue($version->isLessThanOrEqual('5.2.3-alpha.2'));
2424
}
2525

26+
public function testCompareByPreReleaseNumberAlphabetical()
27+
{
28+
$version = Version::parse('5.2.3-alpha.2');
29+
$this->assertTrue($version->isLessThan('5.2.3-alpha.a'));
30+
31+
$version = Version::parse('5.2.3-alpha.a');
32+
$this->assertTrue($version->isGreaterThan('5.2.3-alpha.2'));
33+
}
34+
35+
public function testCompareByPreReleaseAndStable()
36+
{
37+
$version = Version::parse('5.2.3');
38+
$this->assertTrue($version->isGreaterThan('5.2.3-alpha'));
39+
40+
$version = Version::parse('5.2.3-alpha');
41+
$this->assertTrue($version->isLessThan('5.2.3'));
42+
}
43+
2644
public function testGreaterThanByNumbers()
2745
{
2846
$version = Version::parse('5.2.3');

0 commit comments

Comments
 (0)