X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fregistration%2FVersionCheckerTest.php;h=5dc7a969cb6eb93f3d67a2677206079319aa3471;hp=6f0de160f5ef150700665e8c01fe34a9f9b76628;hb=60392920a7e24da5b04a5cdb62197e5487feba36;hpb=6b3e5511fb848890f174690885e748b90389c0b8 diff --git a/tests/phpunit/includes/registration/VersionCheckerTest.php b/tests/phpunit/includes/registration/VersionCheckerTest.php index 6f0de160f5..5dc7a969cb 100644 --- a/tests/phpunit/includes/registration/VersionCheckerTest.php +++ b/tests/phpunit/includes/registration/VersionCheckerTest.php @@ -3,9 +3,10 @@ /** * @covers VersionChecker */ -class VersionCheckerTest extends PHPUnit_Framework_TestCase { +class VersionCheckerTest extends PHPUnit\Framework\TestCase { use MediaWikiCoversValidator; + use PHPUnit4And6Compat; /** * @dataProvider provideCheck @@ -54,6 +55,7 @@ class VersionCheckerTest extends PHPUnit_Framework_TestCase { 'FakeDependency' => [ 'version' => '1.0.0', ], + 'NoVersionGiven' => [], ] ); $this->assertEquals( $expected, $checker->checkArray( [ 'FakeExtension' => $given, @@ -78,6 +80,39 @@ class VersionCheckerTest extends PHPUnit_Framework_TestCase { ], [] ], + [ + [ + 'extensions' => [ + 'NoVersionGiven' => '*' + ] + ], + [], + ], + [ + [ + 'extensions' => [ + 'NoVersionGiven' => '1.0', + ] + ], + [ 'NoVersionGiven does not expose its version, but FakeExtension requires: 1.0.' ], + ], + [ + [ + 'extensions' => [ + 'Missing' => '*', + ] + ], + [ 'FakeExtension requires Missing to be installed.' ], + ], + [ + [ + 'extensions' => [ + 'FakeDependency' => '2.0.0', + ] + ], + // phpcs:ignore Generic.Files.LineLength.TooLong + [ 'FakeExtension is not compatible with the current installed version of FakeDependency (1.0.0), it requires: 2.0.0.' ], + ] ]; }