Merge "test: Assert that API generators have unique prefixes"
[lhc/web/wiklou.git] / tests / phpunit / includes / search / SearchEnginePrefixTest.php
index dd12590..41c1218 100644 (file)
@@ -45,6 +45,9 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
                $this->insertPage( 'Talk:Example' );
 
                $this->insertPage( 'User:Example' );
+               $this->insertPage( 'Barcelona' );
+               $this->insertPage( 'Barbara' );
+               $this->insertPage( 'External' );
        }
 
        protected function setUp() {
@@ -66,7 +69,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
                $this->originalHandlers = TestingAccessWrapper::newFromClass( Hooks::class )->handlers;
                TestingAccessWrapper::newFromClass( Hooks::class )->handlers = [];
 
-               SpecialPageFactory::resetList();
+               $this->overrideMwServices();
        }
 
        public function tearDown() {
@@ -74,7 +77,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
 
                TestingAccessWrapper::newFromClass( Hooks::class )->handlers = $this->originalHandlers;
 
-               SpecialPageFactory::resetList();
+               $this->overrideMwServices();
        }
 
        protected function searchProvision( array $results = null ) {
@@ -238,7 +241,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
                                ],
                        ] ],
                        [ [
-                               'Exact match not on top (T72958)',
+                               'Exact match not in first result should be moved to the first result (T72958)',
                                'provision' => [
                                        'Barcelona',
                                        'Bar',
@@ -252,7 +255,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
                                ],
                        ] ],
                        [ [
-                               'Exact match missing (T72958)',
+                               'Exact match missing from results should be added as first result (T72958)',
                                'provision' => [
                                        'Barcelona',
                                        'Barbara',
@@ -266,7 +269,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
                                ],
                        ] ],
                        [ [
-                               'Exact match missing and not existing',
+                               'Exact match missing and not existing pages should be dropped',
                                'provision' => [
                                        'Exile',
                                        'Exist',
@@ -274,8 +277,6 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
                                ],
                                'query' => 'Ex',
                                'results' => [
-                                       'Exile',
-                                       'Exist',
                                        'External',
                                ],
                        ] ],