X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FPrefixSearchTest.php;h=a6cf14a3adce8f308187b078007d91519101f514;hb=8ddf721b6feaf11c67aafc1445d255e68faa4007;hp=31ee75b7883b9909c6ecfe56df33d684ce4f316b;hpb=2d71bf187d5a56ed808a5ae3845d14e51008f195;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/PrefixSearchTest.php b/tests/phpunit/includes/PrefixSearchTest.php index 31ee75b788..a6cf14a3ad 100644 --- a/tests/phpunit/includes/PrefixSearchTest.php +++ b/tests/phpunit/includes/PrefixSearchTest.php @@ -210,6 +210,11 @@ class PrefixSearchTest extends MediaWikiLangTestCase { $namespaces = isset( $case['namespaces'] ) ? $case['namespaces'] : []; + if ( wfGetDB( DB_REPLICA )->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( @@ -232,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