Mglaser has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/350402 )

Change subject: NamespaceManager: normalized available namespaces
......................................................................

NamespaceManager: normalized available namespaces

This commit injects a namespace config into the tests. Thus the tests
run independent of the wiki environment

Change-Id: I3eaa38af4dd90206cfa6e1aa74ab3bf5ecfa8fad
---
M NamespaceManager/tests/phpunit/BSApiNamespaceStoreTest.php
1 file changed, 44 insertions(+), 5 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/02/350402/1

diff --git a/NamespaceManager/tests/phpunit/BSApiNamespaceStoreTest.php 
b/NamespaceManager/tests/phpunit/BSApiNamespaceStoreTest.php
index 560d694..7864ce2 100644
--- a/NamespaceManager/tests/phpunit/BSApiNamespaceStoreTest.php
+++ b/NamespaceManager/tests/phpunit/BSApiNamespaceStoreTest.php
@@ -3,12 +3,13 @@
 /**
  * @group medium
  * @group API
+ * @group Database
  * @group BlueSpice
  * @group BlueSpiceExtensions
  * @group BlueSpiceNamespaceManager
  */
 class BSApiNamespaceStoreTest extends BSApiExtJSStoreTestBase {
-       protected $iFixtureTotal = 21;
+       protected $iFixtureTotal = 18;
 
        protected function getStoreSchema () {
                return [
@@ -39,8 +40,46 @@
                ];
        }
 
-       protected function createStoreFixtureData () {
-               return 21;
+       protected function setUp() {
+               parent::setUp();
+               $this->setMwGlobals( [
+                       'wgNamespacesWithSubpages' => [
+                               99990 => true
+                       ],
+                       'wgNamespacesToBeSearchedDefault' => [
+                               99990 => true
+                       ]
+               ] );
+               Hooks::clear( 'LanguageGetNamespaces' );
+               Hooks::register( 'LanguageGetNamespaces', function( 
&$namespaces ){
+                       $namespaces = [
+                               -2 => 'Media',
+                               -1 => 'Special',
+                               0 => '',
+                               1 => 'Talk',
+                               2 => 'User',
+                               3 => 'User_talk',
+                               4 => 'Project',
+                               5 => 'Project_talk',
+                               6 => 'File',
+                               7 => 'File_talk',
+                               8 => 'MediaWiki',
+                               9 => 'MediaWiki_talk',
+                               10 => 'Template',
+                               11 => 'Template_talk',
+                               12 => 'Help',
+                               13 => 'Help_talk',
+                               14 => 'Category',
+                               15 => 'Category_talk',
+                               99990 => 'Test',
+                               99991 => 'Test_talk'
+                       ];
+                       return true;
+               });
+       }
+
+       protected function createStoreFixtureData() {
+               return true;
        }
 
        protected function getModuleName () {
@@ -49,7 +88,7 @@
 
        public function provideSingleFilterData() {
                return [
-                       'Filter by isSystemNS' => [ 'boolean', 'eq', 
'isSystemNS', false, 3 ]
+                       'Filter by isSystemNS' => [ 'boolean', 'eq', 
'isSystemNS', false, 2 ]
                ];
        }
 
@@ -70,7 +109,7 @@
                                                'value' => true
                                        ]
                                ],
-                               2
+                               1
                        ]
                ];
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/350402
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3eaa38af4dd90206cfa6e1aa74ab3bf5ecfa8fad
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: master
Gerrit-Owner: Mglaser <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to