TestingAccessWrapper::newFromClass( 'Hooks' )->handlers = [];
// Clear caches so that our new namespace appears
- MWNamespace::getCanonicalNamespaces( true );
+ MWNamespace::clearCaches();
Language::factory( 'en' )->resetNamespaces();
SpecialPageFactory::resetList();
}
public function tearDown() {
+ MWNamespace::clearCaches();
+ Language::factory( 'en' )->resetNamespaces();
+
parent::tearDown();
TestingAccessWrapper::newFromClass( 'Hooks' )->handlers = $this->originalHandlers;
$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