X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fphpunit%2Fincludes%2FPrefixSearchTest.php;h=560692417ffb0307d029d5012c98f3a05375307f;hb=84662b72f073f2df3aa8e8e209da0bc568b91716;hp=ed34a8ab9bb940c79c307ab4f18d2424b7c06599;hpb=526341516a91502ac7cfd2e5590e7432b3f50c5d;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/PrefixSearchTest.php b/tests/phpunit/includes/PrefixSearchTest.php index ed34a8ab9b..560692417f 100644 --- a/tests/phpunit/includes/PrefixSearchTest.php +++ b/tests/phpunit/includes/PrefixSearchTest.php @@ -50,7 +50,7 @@ class PrefixSearchTest extends MediaWikiLangTestCase { $this->markTestSkipped( 'Main namespace does not support wikitext.' ); } - // Avoid special pages from extensions interferring with the tests + // Avoid special pages from extensions interfering with the tests $this->setMwGlobals( [ 'wgSpecialPages' => [], 'wgHooks' => [], @@ -61,17 +61,10 @@ class PrefixSearchTest extends MediaWikiLangTestCase { $this->originalHandlers = TestingAccessWrapper::newFromClass( Hooks::class )->handlers; TestingAccessWrapper::newFromClass( Hooks::class )->handlers = []; - // Clear caches so that our new namespace appears - MWNamespace::clearCaches(); - Language::factory( 'en' )->resetNamespaces(); - SpecialPageFactory::resetList(); } public function tearDown() { - MWNamespace::clearCaches(); - Language::factory( 'en' )->resetNamespaces(); - parent::tearDown(); TestingAccessWrapper::newFromClass( Hooks::class )->handlers = $this->originalHandlers; @@ -209,9 +202,11 @@ class PrefixSearchTest extends MediaWikiLangTestCase { * @covers PrefixSearch::searchBackend */ public function testSearch( array $case ) { + // FIXME: fails under postgres + $this->markTestSkippedIfDbType( 'postgres' ); $this->searchProvision( null ); - $namespaces = isset( $case['namespaces'] ) ? $case['namespaces'] : []; + $namespaces = $case['namespaces'] ?? []; if ( wfGetDB( DB_REPLICA )->getType() === 'postgres' ) { // Postgres will sort lexicographically on utf8 code units (" " before "/") @@ -233,9 +228,11 @@ class PrefixSearchTest extends MediaWikiLangTestCase { * @covers PrefixSearch::searchBackend */ public function testSearchWithOffset( array $case ) { + // FIXME: fails under postgres + $this->markTestSkippedIfDbType( 'postgres' ); $this->searchProvision( null ); - $namespaces = isset( $case['namespaces'] ) ? $case['namespaces'] : []; + $namespaces = $case['namespaces'] ?? []; $searcher = new StringPrefixSearch; $results = $searcher->search( $case['query'], 3, $namespaces, 1 );