<?php
+
+use Wikimedia\TestingAccessWrapper;
+
/**
* @group Search
* @group Database
$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(
$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
],
] ],
[ [
- 'Exact match not on top (bug 70958)',
+ 'Exact match not on top (T72958)',
'provision' => [
'Barcelona',
'Bar',
],
] ],
[ [
- 'Exact match missing (bug 70958)',
+ 'Exact match missing (T72958)',
'provision' => [
'Barcelona',
'Barbara',