X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fphpunit%2Fincludes%2FPrefixSearchTest.php;h=a6cf14a3adce8f308187b078007d91519101f514;hb=eb04b990fedf02de878a73b7c40de9e60a1fa2fc;hp=c5a7e04e30db0083620b920393b30763c56d8399;hpb=b8da5c83743ea31c6f73c063508384f114748537;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/PrefixSearchTest.php b/tests/phpunit/includes/PrefixSearchTest.php index c5a7e04e30..a6cf14a3ad 100644 --- a/tests/phpunit/includes/PrefixSearchTest.php +++ b/tests/phpunit/includes/PrefixSearchTest.php @@ -1,4 +1,7 @@ getType() === 'postgres' ) { + // Postgres will sort lexicographically on utf8 code units (" " before "/") + sort( $case['results'], SORT_STRING ); + } + $searcher = new StringPrefixSearch; $results = $searcher->search( $case['query'], 3, $namespaces ); $this->assertEquals( @@ -229,6 +237,11 @@ class PrefixSearchTest extends MediaWikiLangTestCase { $searcher = new StringPrefixSearch; $results = $searcher->search( $case['query'], 3, $namespaces, 1 ); + if ( wfGetDB( DB_REPLICA )->getType() === 'postgres' ) { + // Postgres will sort lexicographically on utf8 code units (" " before "/") + sort( $case['results'], SORT_STRING ); + } + // We don't expect the first result when offsetting array_shift( $case['results'] ); // And sometimes we expect a different last result @@ -260,7 +273,7 @@ class PrefixSearchTest extends MediaWikiLangTestCase { ], ] ], [ [ - 'Exact match not on top (bug 70958)', + 'Exact match not on top (T72958)', 'provision' => [ 'Barcelona', 'Bar', @@ -274,7 +287,7 @@ class PrefixSearchTest extends MediaWikiLangTestCase { ], ] ], [ [ - 'Exact match missing (bug 70958)', + 'Exact match missing (T72958)', 'provision' => [ 'Barcelona', 'Barbara',