From daaeb407afbcc9e81840e14d0201fa4590cdff12 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 18 May 2017 13:29:13 -0700 Subject: [PATCH] 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 --- .../includes/search/SearchEnginePrefixTest.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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, -- 2.20.1