mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-24 03:49:10 -04:00
ALPHA 3.0.2a
This commit is contained in:
@@ -13,11 +13,11 @@ namespace PharIo\Version;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers PharIo\Version\AndVersionConstraintGroup
|
||||
* @covers \PharIo\Version\AndVersionConstraintGroup
|
||||
*/
|
||||
class AndVersionConstraintGroupTest extends TestCase {
|
||||
public function testReturnsFalseIfOneConstraintReturnsFalse() {
|
||||
$firstConstraint = $this->createMock(VersionConstraint::class);
|
||||
$firstConstraint = $this->createMock(VersionConstraint::class);
|
||||
$secondConstraint = $this->createMock(VersionConstraint::class);
|
||||
|
||||
$firstConstraint->expects($this->once())
|
||||
@@ -34,7 +34,7 @@ class AndVersionConstraintGroupTest extends TestCase {
|
||||
}
|
||||
|
||||
public function testReturnsTrueIfAllConstraintsReturnsTrue() {
|
||||
$firstConstraint = $this->createMock(VersionConstraint::class);
|
||||
$firstConstraint = $this->createMock(VersionConstraint::class);
|
||||
$secondConstraint = $this->createMock(VersionConstraint::class);
|
||||
|
||||
$firstConstraint->expects($this->once())
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace PharIo\Version;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers PharIo\Version\AnyVersionConstraint
|
||||
* @covers \PharIo\Version\AnyVersionConstraint
|
||||
*/
|
||||
class AnyVersionConstraintTest extends TestCase {
|
||||
public function versionProvider() {
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace PharIo\Version;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers PharIo\Version\ExactVersionConstraint
|
||||
* @covers \PharIo\Version\ExactVersionConstraint
|
||||
*/
|
||||
class ExactVersionConstraintTest extends TestCase {
|
||||
public function compliantVersionProvider() {
|
||||
@@ -35,7 +35,7 @@ class ExactVersionConstraintTest extends TestCase {
|
||||
/**
|
||||
* @dataProvider compliantVersionProvider
|
||||
*
|
||||
* @param string $constraintValue
|
||||
* @param string $constraintValue
|
||||
* @param Version $version
|
||||
*/
|
||||
public function testReturnsTrueForCompliantVersion($constraintValue, Version $version) {
|
||||
@@ -47,7 +47,7 @@ class ExactVersionConstraintTest extends TestCase {
|
||||
/**
|
||||
* @dataProvider nonCompliantVersionProvider
|
||||
*
|
||||
* @param string $constraintValue
|
||||
* @param string $constraintValue
|
||||
* @param Version $version
|
||||
*/
|
||||
public function testReturnsFalseForNonCompliantVersion($constraintValue, Version $version) {
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace PharIo\Version;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers PharIo\Version\GreaterThanOrEqualToVersionConstraint
|
||||
* @covers \PharIo\Version\GreaterThanOrEqualToVersionConstraint
|
||||
*/
|
||||
class GreaterThanOrEqualToVersionConstraintTest extends TestCase {
|
||||
public function versionProvider() {
|
||||
@@ -37,7 +37,7 @@ class GreaterThanOrEqualToVersionConstraintTest extends TestCase {
|
||||
*
|
||||
* @param Version $constraintVersion
|
||||
* @param Version $version
|
||||
* @param bool $expectedResult
|
||||
* @param bool $expectedResult
|
||||
*/
|
||||
public function testReturnsTrueForCompliantVersions(Version $constraintVersion, Version $version, $expectedResult) {
|
||||
$constraint = new GreaterThanOrEqualToVersionConstraint('foo', $constraintVersion);
|
||||
|
||||
@@ -13,11 +13,11 @@ namespace PharIo\Version;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers PharIo\Version\OrVersionConstraintGroup
|
||||
* @covers \PharIo\Version\OrVersionConstraintGroup
|
||||
*/
|
||||
class OrVersionConstraintGroupTest extends TestCase {
|
||||
public function testReturnsTrueIfOneConstraintReturnsFalse() {
|
||||
$firstConstraint = $this->createMock(VersionConstraint::class);
|
||||
$firstConstraint = $this->createMock(VersionConstraint::class);
|
||||
$secondConstraint = $this->createMock(VersionConstraint::class);
|
||||
|
||||
$firstConstraint->expects($this->once())
|
||||
@@ -34,7 +34,7 @@ class OrVersionConstraintGroupTest extends TestCase {
|
||||
}
|
||||
|
||||
public function testReturnsTrueIfAllConstraintsReturnsTrue() {
|
||||
$firstConstraint = $this->createMock(VersionConstraint::class);
|
||||
$firstConstraint = $this->createMock(VersionConstraint::class);
|
||||
$secondConstraint = $this->createMock(VersionConstraint::class);
|
||||
|
||||
$firstConstraint->expects($this->once())
|
||||
@@ -47,7 +47,7 @@ class OrVersionConstraintGroupTest extends TestCase {
|
||||
}
|
||||
|
||||
public function testReturnsFalseIfAllConstraintsReturnsFalse() {
|
||||
$firstConstraint = $this->createMock(VersionConstraint::class);
|
||||
$firstConstraint = $this->createMock(VersionConstraint::class);
|
||||
$secondConstraint = $this->createMock(VersionConstraint::class);
|
||||
|
||||
$firstConstraint->expects($this->once())
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace PharIo\Version;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers PharIo\Version\SpecificMajorAndMinorVersionConstraint
|
||||
* @covers \PharIo\Version\SpecificMajorAndMinorVersionConstraint
|
||||
*/
|
||||
class SpecificMajorAndMinorVersionConstraintTest extends TestCase {
|
||||
public function versionProvider() {
|
||||
@@ -32,10 +32,10 @@ class SpecificMajorAndMinorVersionConstraintTest extends TestCase {
|
||||
/**
|
||||
* @dataProvider versionProvider
|
||||
*
|
||||
* @param int $major
|
||||
* @param int $minor
|
||||
* @param int $major
|
||||
* @param int $minor
|
||||
* @param Version $version
|
||||
* @param bool $expectedResult
|
||||
* @param bool $expectedResult
|
||||
*/
|
||||
public function testReturnsTrueForCompliantVersions($major, $minor, Version $version, $expectedResult) {
|
||||
$constraint = new SpecificMajorAndMinorVersionConstraint('foo', $major, $minor);
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace PharIo\Version;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @covers PharIo\Version\SpecificMajorVersionConstraint
|
||||
* @covers \PharIo\Version\SpecificMajorVersionConstraint
|
||||
*/
|
||||
class SpecificMajorVersionConstraintTest extends TestCase {
|
||||
public function versionProvider() {
|
||||
@@ -32,9 +32,9 @@ class SpecificMajorVersionConstraintTest extends TestCase {
|
||||
/**
|
||||
* @dataProvider versionProvider
|
||||
*
|
||||
* @param int $major
|
||||
* @param int $major
|
||||
* @param Version $version
|
||||
* @param bool $expectedResult
|
||||
* @param bool $expectedResult
|
||||
*/
|
||||
public function testReturnsTrueForCompliantVersions($major, Version $version, $expectedResult) {
|
||||
$constraint = new SpecificMajorVersionConstraint('foo', $major);
|
||||
|
||||
@@ -24,9 +24,16 @@ class VersionTest extends TestCase {
|
||||
* @param string $expectedMinor
|
||||
* @param string $expectedPatch
|
||||
* @param string $expectedPreReleaseValue
|
||||
* @param int $expectedReleaseCount
|
||||
* @param int $expectedReleaseCount
|
||||
*/
|
||||
public function testParsesVersionNumbers($versionString, $expectedMajor, $expectedMinor, $expectedPatch, $expectedPreReleaseValue = '', $expectedReleaseCount = 0) {
|
||||
public function testParsesVersionNumbers(
|
||||
$versionString,
|
||||
$expectedMajor,
|
||||
$expectedMinor,
|
||||
$expectedPatch,
|
||||
$expectedPreReleaseValue = '',
|
||||
$expectedReleaseCount = 0
|
||||
) {
|
||||
$version = new Version($versionString);
|
||||
|
||||
$this->assertSame($expectedMajor, $version->getMajor()->getValue());
|
||||
@@ -56,7 +63,7 @@ class VersionTest extends TestCase {
|
||||
*
|
||||
* @param Version $versionA
|
||||
* @param Version $versionB
|
||||
* @param bool $expectedResult
|
||||
* @param bool $expectedResult
|
||||
*/
|
||||
public function testIsGreaterThan(Version $versionA, Version $versionB, $expectedResult) {
|
||||
$this->assertSame($expectedResult, $versionA->isGreaterThan($versionB));
|
||||
@@ -75,6 +82,10 @@ class VersionTest extends TestCase {
|
||||
[new Version('2.5.8'), new Version('1.6.8'), true],
|
||||
[new Version('2.5.8'), new Version('2.6.8'), false],
|
||||
[new Version('2.5.8'), new Version('3.1.2'), false],
|
||||
[new Version('3.0.0-alpha1'), new Version('3.0.0-alpha2'), false],
|
||||
[new Version('3.0.0-alpha2'), new Version('3.0.0-alpha1'), true],
|
||||
[new Version('3.0.0-alpha.1'), new Version('3.0.0'), false],
|
||||
[new Version('3.0.0'), new Version('3.0.0-alpha.1'), true],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -83,8 +94,7 @@ class VersionTest extends TestCase {
|
||||
*
|
||||
* @param string $versionString
|
||||
*/
|
||||
public function testThrowsExceptionIfVersionStringDoesNotFollowSemVer($versionString)
|
||||
{
|
||||
public function testThrowsExceptionIfVersionStringDoesNotFollowSemVer($versionString) {
|
||||
$this->expectException(InvalidVersionException::class);
|
||||
new Version($versionString);
|
||||
}
|
||||
@@ -92,8 +102,7 @@ class VersionTest extends TestCase {
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function invalidVersionStringProvider()
|
||||
{
|
||||
public function invalidVersionStringProvider() {
|
||||
return [
|
||||
['foo'],
|
||||
['0.0.1-dev+ABC', '0', '0', '1', 'dev', 'ABC'],
|
||||
|
||||
Reference in New Issue
Block a user