class SemVerTest
Tests Drupal\Composer\Plugin\RecipeUnpack\SemVer.
Attributes
#[CoversClass(SemVer::class)]
#[Group('Unpack')]
Hierarchy
- class \Drupal\Tests\Composer\Plugin\Unpack\SemVerTest extends \PHPUnit\Framework\TestCase
Expanded class hierarchy of SemVerTest
File
-
core/
tests/ Drupal/ Tests/ Composer/ Plugin/ Unpack/ SemVerTest.php, line 17
Namespace
Drupal\Tests\Composer\Plugin\UnpackView source
class SemVerTest extends TestCase {
/**
* Tests minimize constraints.
*
* @legacy-covers ::minimizeConstraints
*/
public function testMinimizeConstraints(string $constraint_a, string $constraint_b, string $expected) : void {
$version_parser = new VersionParser();
$this->assertSame($expected, SemVer::minimizeConstraints($version_parser, $constraint_a, $constraint_b));
$this->assertSame($expected, SemVer::minimizeConstraints($version_parser, $constraint_b, $constraint_a));
}
/**
* Tests minimize constraints which are not subsets.
*
* @legacy-covers ::minimizeConstraints
*/
public function testMinimizeConstraintsWhichAreNotSubsets(string $constraint_a, string $constraint_b, string $expected) : void {
$this->assertSame($expected, SemVer::minimizeConstraints(new VersionParser(), $constraint_a, $constraint_b));
}
/**
* Tests minimize constraints which do not intersect.
*
* @legacy-covers ::minimizeConstraints
*/
public function testMinimizeConstraintsWhichDoNotIntersect(string $constraint_a, string $constraint_b, string $expected) : void {
$this->expectException(\LogicException::class);
$this->expectExceptionMessage('The constraints "^6.1" and "^5.1" do not intersect and cannot be minimized.');
$this->assertSame($expected, SemVer::minimizeConstraints(new VersionParser(), $constraint_a, $constraint_b));
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
SemVerTest::testMinimizeConstraints | public | function | Tests minimize constraints. |
SemVerTest::testMinimizeConstraintsWhichAreNotSubsets | public | function | Tests minimize constraints which are not subsets. |
SemVerTest::testMinimizeConstraintsWhichDoNotIntersect | public | function | Tests minimize constraints which do not intersect. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.