Avoid SearchEnginePrefixTest postgres failures
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 18 May 2017 20:29:13 +0000 (13:29 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Tue, 23 May 2017 00:28:42 +0000 (17:28 -0700)
Slash was ranked a bit differently in how postgres sorts
(seems to be based on the utf8 units as raw bytes).

Bug: T75174
Change-Id: I0a7f3859945218319b3f418f607c0299d8569c61

tests/phpunit/includes/search/SearchEnginePrefixTest.php

index 63ed93e..fbbcee5 100644 (file)
@@ -28,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' );
@@ -96,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',
                                ],
                        ] ],
                        [ [
@@ -183,6 +188,7 @@ class SearchEnginePrefixTest extends MediaWikiLangTestCase {
                $results = array_map( function( Title $t ) {
                        return $t->getPrefixedText();
                }, $results );
+
                $this->assertEquals(
                        $case['results'],
                        $results,