X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FPrefixSearchTest.php;h=3bde5de41ff6f5f45323d627eee67340d430e8ef;hb=138298b397b308ad6e4bfc7088884d90e8ac1e37;hp=2f3e569613d7ed2a42eedff26aaf2d9bc6fd7411;hpb=5fa4cdf860c79b32ab6ef034c6d9420c2727f695;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/PrefixSearchTest.php b/tests/phpunit/includes/PrefixSearchTest.php index 2f3e569613..3bde5de41f 100644 --- a/tests/phpunit/includes/PrefixSearchTest.php +++ b/tests/phpunit/includes/PrefixSearchTest.php @@ -58,8 +58,8 @@ class PrefixSearchTest extends MediaWikiLangTestCase { 'wgCapitalLinkOverrides' => [ self::NS_NONCAP => false ], ] ); - $this->originalHandlers = TestingAccessWrapper::newFromClass( 'Hooks' )->handlers; - TestingAccessWrapper::newFromClass( 'Hooks' )->handlers = []; + $this->originalHandlers = TestingAccessWrapper::newFromClass( Hooks::class )->handlers; + TestingAccessWrapper::newFromClass( Hooks::class )->handlers = []; // Clear caches so that our new namespace appears MWNamespace::clearCaches(); @@ -74,7 +74,7 @@ class PrefixSearchTest extends MediaWikiLangTestCase { parent::tearDown(); - TestingAccessWrapper::newFromClass( 'Hooks' )->handlers = $this->originalHandlers; + TestingAccessWrapper::newFromClass( Hooks::class )->handlers = $this->originalHandlers; SpecialPageFactory::resetList(); } @@ -211,7 +211,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 +235,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 );