Handle extension dependencies in the installer
[lhc/web/wiklou.git] / tests / phpunit / includes / registration / VersionCheckerTest.php
index 929ff0f..f65fcc7 100644 (file)
@@ -93,7 +93,11 @@ class VersionCheckerTest extends PHPUnit\Framework\TestCase {
                                                'NoVersionGiven' => '1.0',
                                        ]
                                ],
-                               [ 'NoVersionGiven does not expose its version, but FakeExtension requires: 1.0.' ],
+                               [ [
+                                       'incompatible' => 'FakeExtension',
+                                       'type' => 'incompatible-extensions',
+                                       'msg' => 'NoVersionGiven does not expose its version, but FakeExtension requires: 1.0.'
+                               ] ],
                        ],
                        [
                                [
@@ -101,7 +105,11 @@ class VersionCheckerTest extends PHPUnit\Framework\TestCase {
                                                'Missing' => '*',
                                        ]
                                ],
-                               [ 'FakeExtension requires Missing to be installed.' ],
+                               [ [
+                                       'missing' => 'Missing',
+                                       'type' => 'missing-extensions',
+                                       'msg' => 'FakeExtension requires Missing to be installed.',
+                               ] ],
                        ],
                        [
                                [
@@ -109,8 +117,12 @@ class VersionCheckerTest extends PHPUnit\Framework\TestCase {
                                                '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.' ],
+                               [ [
+                                       'incompatible' => 'FakeExtension',
+                                       'type' => 'incompatible-extensions',
+                                       // phpcs:ignore Generic.Files.LineLength.TooLong
+                                       'msg' => 'FakeExtension is not compatible with the current installed version of FakeDependency (1.0.0), it requires: 2.0.0.'
+                               ] ],
                        ]
                ];
        }
@@ -127,7 +139,11 @@ class VersionCheckerTest extends PHPUnit\Framework\TestCase {
                                        'version' => 'not really valid',
                                ],
                        ] );
-               $this->assertEquals( [ "FakeDependency does not have a valid version string." ],
+               $this->assertEquals(
+                       [ [
+                               'type' => 'invalid-version',
+                               'msg' => "FakeDependency does not have a valid version string."
+                       ] ],
                        $checker->checkArray( [
                                'FakeExtension' => [
                                        'extensions' => [