X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles_versions%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FPrefixSearchTest.php;h=98ec7e027c4bb964de7934af63d721708d849601;hb=63d7f2ad1345453dc16f16493fc7e5524219cfb8;hp=ed34a8ab9bb940c79c307ab4f18d2424b7c06599;hpb=e69bcfad17d67da5113cdd75276a5f7b5cefb123;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/PrefixSearchTest.php b/tests/phpunit/includes/PrefixSearchTest.php index ed34a8ab9b..98ec7e027c 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; @@ -211,7 +204,7 @@ class PrefixSearchTest extends MediaWikiLangTestCase { public function testSearch( array $case ) { $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 "/") @@ -235,7 +228,7 @@ class PrefixSearchTest extends MediaWikiLangTestCase { public function testSearchWithOffset( array $case ) { $this->searchProvision( null ); - $namespaces = isset( $case['namespaces'] ) ? $case['namespaces'] : []; + $namespaces = $case['namespaces'] ?? []; $searcher = new StringPrefixSearch; $results = $searcher->search( $case['query'], 3, $namespaces, 1 );