Merge "RCFilters: Style the Saved Links placeholder and add a title"
[lhc/web/wiklou.git] / tests / phpunit / includes / search / SearchEnginePrefixTest.php
index a88264b..fbbcee5 100644 (file)
@@ -1,5 +1,7 @@
 <?php
+
 use MediaWiki\MediaWikiServices;
+use Wikimedia\TestingAccessWrapper;
 
 /**
  * @group Search
@@ -26,6 +28,11 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
                $this->insertPage( 'Example Foo' );
                $this->insertPage( 'Example Foo/Bar' );
                $this->insertPage( 'Example/Baz' );
+               $this->insertPage( 'Sample' );
+               $this->insertPage( 'Sample Ban' );
+               $this->insertPage( 'Sample Eat' );
+               $this->insertPage( 'Sample Who' );
+               $this->insertPage( 'Sample Zoo' );
                $this->insertPage( 'Redirect test', '#REDIRECT [[Redirect Test]]' );
                $this->insertPage( 'Redirect Test' );
                $this->insertPage( 'Redirect Test Worse Result' );
@@ -94,15 +101,15 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
                        ] ],
                        [ [
                                'Main namespace with title prefix',
-                               'query' => 'Ex',
+                               'query' => 'Sa',
                                'results' => [
-                                       'Example',
-                                       'Example/Baz',
-                                       'Example Bar',
+                                       'Sample',
+                                       'Sample Ban',
+                                       'Sample Eat',
                                ],
                                // Third result when testing offset
                                'offsetresult' => [
-                                       'Example Foo',
+                                       'Sample Who',
                                ],
                        ] ],
                        [ [
@@ -181,6 +188,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
                $results = array_map( function( Title $t ) {
                        return $t->getPrefixedText();
                }, $results );
+
                $this->assertEquals(
                        $case['results'],
                        $results,
@@ -230,7 +238,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
                                ],
                        ] ],
                        [ [
-                               'Exact match not on top (bug 70958)',
+                               'Exact match not on top (T72958)',
                                'provision' => [
                                        'Barcelona',
                                        'Bar',
@@ -244,7 +252,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
                                ],
                        ] ],
                        [ [
-                               'Exact match missing (bug 70958)',
+                               'Exact match missing (T72958)',
                                'provision' => [
                                        'Barcelona',
                                        'Barbara',