From: Aaron Schulz Date: Thu, 18 May 2017 20:29:13 +0000 (-0700) Subject: Avoid SearchEnginePrefixTest postgres failures X-Git-Tag: 1.31.0-rc.0~3176^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=daaeb407afbcc9e81840e14d0201fa4590cdff12;p=lhc%2Fweb%2Fwiklou.git Avoid SearchEnginePrefixTest postgres failures 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 --- diff --git a/tests/phpunit/includes/search/SearchEnginePrefixTest.php b/tests/phpunit/includes/search/SearchEnginePrefixTest.php index 63ed93e191..fbbcee5897 100644 --- a/tests/phpunit/includes/search/SearchEnginePrefixTest.php +++ b/tests/phpunit/includes/search/SearchEnginePrefixTest.php @@ -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,