+ public function testNamespacesProtection() {
+ $this->setMwGlobals(
+ 'wgNamespaceProtection',
+ [
+ '0' => '',
+ '2' => [ '' ],
+ '4' => 'editsemiprotected',
+ '8' => [
+ 'editinterface',
+ 'noratelimit'
+ ],
+ '14' => [
+ 'move-categorypages',
+ ''
+ ]
+ ]
+ );
+ $data = $this->doQuery( 'namespaces' );
+ $this->assertArrayNotHasKey( 'namespaceprotection', $data['0'] );
+ $this->assertArrayNotHasKey( 'namespaceprotection', $data['2'] );
+ $this->assertSame( 'editsemiprotected', $data['4']['namespaceprotection'] );
+ $this->assertSame( 'editinterface|noratelimit', $data['8']['namespaceprotection'] );
+ $this->assertSame( 'move-categorypages', $data['14']['namespaceprotection'] );
+ }
+