SECURITY: blacklist CSS var()
[lhc/web/wiklou.git] / tests / phpunit / includes / PrefixSearchTest.php
index 3bde5de..685cb40 100644 (file)
@@ -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,22 +61,13 @@ 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();
+               $this->overrideMwServices();
        }
 
        public function tearDown() {
-               MWNamespace::clearCaches();
-               Language::factory( 'en' )->resetNamespaces();
-
                parent::tearDown();
 
                TestingAccessWrapper::newFromClass( Hooks::class )->handlers = $this->originalHandlers;
-
-               SpecialPageFactory::resetList();
        }
 
        protected function searchProvision( array $results = null ) {
@@ -209,6 +200,8 @@ class PrefixSearchTest extends MediaWikiLangTestCase {
         * @covers PrefixSearch::searchBackend
         */
        public function testSearch( array $case ) {
+               // FIXME: fails under postgres
+               $this->markTestSkippedIfDbType( 'postgres' );
                $this->searchProvision( null );
 
                $namespaces = $case['namespaces'] ?? [];
@@ -233,6 +226,8 @@ class PrefixSearchTest extends MediaWikiLangTestCase {
         * @covers PrefixSearch::searchBackend
         */
        public function testSearchWithOffset( array $case ) {
+               // FIXME: fails under postgres
+               $this->markTestSkippedIfDbType( 'postgres' );
                $this->searchProvision( null );
 
                $namespaces = $case['namespaces'] ?? [];