public function setup() {
global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContLang;
- $wgExtraNamespaces[ 12302 ] = 'TEST-JS';
- $wgExtraNamespaces[ 12303 ] = 'TEST-JS_TALK';
+ $this->mergeMwGlobalArrayValue(
+ 'wgExtraNamespaces',
+ array(
+ 12302 => 'TEST-JS',
+ 12303 => 'TEST-JS_TALK',
+ )
+ );
- $wgNamespaceContentModels[ 12302 ] = CONTENT_MODEL_JAVASCRIPT;
+ $this->mergeMwGlobalArrayValue(
+ 'wgNamespaceContentModels',
+ array(
+ 12302 => CONTENT_MODEL_JAVASCRIPT,
+ )
+ );
MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache
$wgContLang->resetNamespaces(); # reset namespace cache
}
public function teardown() {
- global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContLang;
-
- unset( $wgExtraNamespaces[ 12302 ] );
- unset( $wgExtraNamespaces[ 12303 ] );
-
- unset( $wgNamespaceContentModels[ 12302 ] );
+ global $wgContLang;
MWNamespace::getCanonicalNamespaces( true ); # reset namespace cache
$wgContLang->resetNamespaces(); # reset namespace cache
}
- public function dataEquals() {
+ public static function provideEquals() {
return array(
array( 'Main Page', 'Main Page', true ),
array( 'Main Page', 'Not The Main Page', false ),
}
/**
- * @dataProvider dataEquals
+ * @dataProvider provideEquals
*/
public function testEquals( $titleA, $titleB, $expectedBool ) {
$titleA = Title::newFromText( $titleA );
$this->assertEquals( $expectedBool, $titleB->equals( $titleA ) );
}
- public function dataInNamespace() {
+ public static function provideInNamespace() {
return array(
array( 'Main Page', NS_MAIN, true ),
array( 'Main Page', NS_TALK, false ),
}
/**
- * @dataProvider dataInNamespace
+ * @dataProvider provideInNamespace
*/
public function testInNamespace( $title, $ns, $expectedBool ) {
$title = Title::newFromText( $title );
$this->assertFalse( $mainpage->inNamespaces( array( NS_PROJECT, NS_TEMPLATE ) ) );
}
- public function dataHasSubjectNamespace() {
+ public static function provideHasSubjectNamespace() {
return array(
array( 'Main Page', NS_MAIN, true ),
array( 'Main Page', NS_TALK, true ),
}
/**
- * @dataProvider dataHasSubjectNamespace
+ * @dataProvider provideHasSubjectNamespace
*/
public function testHasSubjectNamespace( $title, $ns, $expectedBool ) {
$title = Title::newFromText( $title );
$this->assertTrue( $title->hasContentModel( $expectedModelId ) );
}
- public function dataIsCssOrJsPage() {
+ public static function provideIsCssOrJsPage() {
return array(
array( 'Help:Foo', false ),
array( 'Help:Foo.js', false ),
}
/**
- * @dataProvider dataIsCssOrJsPage
+ * @dataProvider provideIsCssOrJsPage
*/
public function testIsCssOrJsPage( $title, $expectedBool ) {
$title = Title::newFromText( $title );
}
- public function dataIsCssJsSubpage() {
+ public static function provideIsCssJsSubpage() {
return array(
array( 'Help:Foo', false ),
array( 'Help:Foo.js', false ),
}
/**
- * @dataProvider dataIsCssJsSubpage
+ * @dataProvider provideIsCssJsSubpage
*/
public function testIsCssJsSubpage( $title, $expectedBool ) {
$title = Title::newFromText( $title );
$this->assertEquals( $expectedBool, $title->isCssJsSubpage() );
}
- public function dataIsCssSubpage() {
+ public static function provideIsCssSubpage() {
return array(
array( 'Help:Foo', false ),
array( 'Help:Foo.css', false ),
}
/**
- * @dataProvider dataIsCssSubpage
+ * @dataProvider provideIsCssSubpage
*/
public function testIsCssSubpage( $title, $expectedBool ) {
$title = Title::newFromText( $title );
$this->assertEquals( $expectedBool, $title->isCssSubpage() );
}
- public function dataIsJsSubpage() {
+ public static function provideIsJsSubpage() {
return array(
array( 'Help:Foo', false ),
array( 'Help:Foo.css', false ),
}
/**
- * @dataProvider dataIsJsSubpage
+ * @dataProvider provideIsJsSubpage
*/
public function testIsJsSubpage( $title, $expectedBool ) {
$title = Title::newFromText( $title );
$this->assertEquals( $expectedBool, $title->isJsSubpage() );
}
- public function dataIsWikitextPage() {
+ public static function provideIsWikitextPage() {
return array(
array( 'Help:Foo', true ),
array( 'Help:Foo.js', true ),
}
/**
- * @dataProvider dataIsWikitextPage
+ * @dataProvider provideIsWikitextPage
*/
public function testIsWikitextPage( $title, $expectedBool ) {
$title = Title::newFromText( $title );