2011-02-21 22:17:06 +00:00
|
|
|
|
<?php
|
|
|
|
|
|
/**
|
2011-10-24 09:08:13 +00:00
|
|
|
|
* @author Antoine Musso
|
|
|
|
|
|
* @copyright Copyright © 2011, Antoine Musso
|
2011-02-21 22:17:06 +00:00
|
|
|
|
* @file
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Test class for MWNamespace.
|
|
|
|
|
|
* Generated by PHPUnit on 2011-02-20 at 21:01:55.
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @todo covers tags
|
2014-07-23 20:04:48 +00:00
|
|
|
|
* @todo FIXME: this test file is a mess
|
2011-02-21 22:17:06 +00:00
|
|
|
|
*
|
|
|
|
|
|
*/
|
2011-05-25 00:30:06 +00:00
|
|
|
|
class MWNamespaceTest extends MediaWikiTestCase {
|
2011-02-21 22:17:06 +00:00
|
|
|
|
protected function setUp() {
|
2012-10-08 10:56:20 +00:00
|
|
|
|
parent::setUp();
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
2012-10-08 10:56:20 +00:00
|
|
|
|
$this->setMwGlobals( array(
|
|
|
|
|
|
'wgContentNamespaces' => array( NS_MAIN ),
|
|
|
|
|
|
'wgNamespacesWithSubpages' => array(
|
2013-02-14 11:22:13 +00:00
|
|
|
|
NS_TALK => true,
|
|
|
|
|
|
NS_USER => true,
|
|
|
|
|
|
NS_USER_TALK => true,
|
2012-10-08 10:56:20 +00:00
|
|
|
|
),
|
|
|
|
|
|
'wgCapitalLinks' => true,
|
|
|
|
|
|
'wgCapitalLinkOverrides' => array(),
|
|
|
|
|
|
'wgNonincludableNamespaces' => array(),
|
|
|
|
|
|
) );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#### START OF TESTS #########################################################
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @todo Write more texts, handle $wgAllowImageMoving setting
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::isMovable
|
2011-02-21 22:17:06 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testIsMovable() {
|
2014-05-05 18:22:53 +00:00
|
|
|
|
$this->assertFalse( MWNamespace::isMovable( NS_SPECIAL ) );
|
2011-05-17 22:03:20 +00:00
|
|
|
|
# @todo FIXME: Write more tests!!
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Please make sure to change testIsTalk() if you change the assertions below
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::isSubject
|
2011-02-21 22:17:06 +00:00
|
|
|
|
*/
|
2011-11-22 13:34:55 +00:00
|
|
|
|
public function testIsSubject() {
|
2011-02-21 22:17:06 +00:00
|
|
|
|
// Special namespaces
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsSubject( NS_MEDIA );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsSubject( NS_SPECIAL );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
|
|
|
|
|
// Subject pages
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsSubject( NS_MAIN );
|
|
|
|
|
|
$this->assertIsSubject( NS_USER );
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsSubject( 100 ); # user defined
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
|
|
|
|
|
// Talk pages
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsNotSubject( NS_TALK );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsNotSubject( NS_USER_TALK );
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsNotSubject( 101 ); # user defined
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2011-11-22 13:34:55 +00:00
|
|
|
|
* Reverse of testIsSubject().
|
|
|
|
|
|
* Please update testIsSubject() if you change assertions below
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::isTalk
|
2011-02-21 22:17:06 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testIsTalk() {
|
|
|
|
|
|
// Special namespaces
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsNotTalk( NS_MEDIA );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsNotTalk( NS_SPECIAL );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
|
|
|
|
|
// Subject pages
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsNotTalk( NS_MAIN );
|
|
|
|
|
|
$this->assertIsNotTalk( NS_USER );
|
|
|
|
|
|
$this->assertIsNotTalk( 100 ); # user defined
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
|
|
|
|
|
// Talk pages
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsTalk( NS_TALK );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsTalk( NS_USER_TALK );
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsTalk( 101 ); # user defined
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2011-11-22 13:34:55 +00:00
|
|
|
|
/**
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::getSubject
|
2011-11-22 13:34:55 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testGetSubject() {
|
|
|
|
|
|
// Special namespaces are their own subjects
|
|
|
|
|
|
$this->assertEquals( NS_MEDIA, MWNamespace::getSubject( NS_MEDIA ) );
|
|
|
|
|
|
$this->assertEquals( NS_SPECIAL, MWNamespace::getSubject( NS_SPECIAL ) );
|
|
|
|
|
|
|
|
|
|
|
|
$this->assertEquals( NS_MAIN, MWNamespace::getSubject( NS_TALK ) );
|
|
|
|
|
|
$this->assertEquals( NS_USER, MWNamespace::getSubject( NS_USER_TALK ) );
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2011-02-21 22:17:06 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* Regular getTalk() calls
|
|
|
|
|
|
* Namespaces without a talk page (NS_MEDIA, NS_SPECIAL) are tested in
|
|
|
|
|
|
* the function testGetTalkExceptions()
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::getTalk
|
2011-02-21 22:17:06 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testGetTalk() {
|
2011-08-24 19:32:40 +00:00
|
|
|
|
$this->assertEquals( NS_TALK, MWNamespace::getTalk( NS_MAIN ) );
|
2011-11-22 13:34:55 +00:00
|
|
|
|
$this->assertEquals( NS_TALK, MWNamespace::getTalk( NS_TALK ) );
|
|
|
|
|
|
$this->assertEquals( NS_USER_TALK, MWNamespace::getTalk( NS_USER ) );
|
|
|
|
|
|
$this->assertEquals( NS_USER_TALK, MWNamespace::getTalk( NS_USER_TALK ) );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Exceptions with getTalk()
|
2011-08-24 19:52:24 +00:00
|
|
|
|
* NS_MEDIA does not have talk pages. MediaWiki raise an exception for them.
|
2011-02-21 22:17:06 +00:00
|
|
|
|
* @expectedException MWException
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::getTalk
|
2011-02-21 22:17:06 +00:00
|
|
|
|
*/
|
2011-08-24 19:52:24 +00:00
|
|
|
|
public function testGetTalkExceptionsForNsMedia() {
|
2011-05-14 12:01:08 +00:00
|
|
|
|
$this->assertNull( MWNamespace::getTalk( NS_MEDIA ) );
|
2011-08-24 19:52:24 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2011-12-12 15:26:12 +00:00
|
|
|
|
/**
|
2011-08-24 19:52:24 +00:00
|
|
|
|
* Exceptions with getTalk()
|
|
|
|
|
|
* NS_SPECIAL does not have talk pages. MediaWiki raise an exception for them.
|
|
|
|
|
|
* @expectedException MWException
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::getTalk
|
2011-08-24 19:52:24 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testGetTalkExceptionsForNsSpecial() {
|
2011-05-14 12:01:08 +00:00
|
|
|
|
$this->assertNull( MWNamespace::getTalk( NS_SPECIAL ) );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2011-08-24 19:32:40 +00:00
|
|
|
|
* Regular getAssociated() calls
|
2011-02-21 22:17:06 +00:00
|
|
|
|
* Namespaces without an associated page (NS_MEDIA, NS_SPECIAL) are tested in
|
|
|
|
|
|
* the function testGetAssociatedExceptions()
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::getAssociated
|
2011-02-21 22:17:06 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testGetAssociated() {
|
2011-11-22 13:34:55 +00:00
|
|
|
|
$this->assertEquals( NS_TALK, MWNamespace::getAssociated( NS_MAIN ) );
|
2011-08-24 19:32:40 +00:00
|
|
|
|
$this->assertEquals( NS_MAIN, MWNamespace::getAssociated( NS_TALK ) );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
### Exceptions with getAssociated()
|
|
|
|
|
|
### NS_MEDIA and NS_SPECIAL do not have talk pages. MediaWiki raises
|
|
|
|
|
|
### an exception for them.
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @expectedException MWException
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::getAssociated
|
2011-02-21 22:17:06 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testGetAssociatedExceptionsForNsMedia() {
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertNull( MWNamespace::getAssociated( NS_MEDIA ) );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
2011-08-24 19:52:24 +00:00
|
|
|
|
|
2011-02-21 22:17:06 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* @expectedException MWException
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::getAssociated
|
2011-02-21 22:17:06 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testGetAssociatedExceptionsForNsSpecial() {
|
|
|
|
|
|
$this->assertNull( MWNamespace::getAssociated( NS_SPECIAL ) );
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* @todo Implement testExists().
|
|
|
|
|
|
*/
|
2013-02-14 11:22:13 +00:00
|
|
|
|
/*
|
2011-02-21 22:17:06 +00:00
|
|
|
|
public function testExists() {
|
|
|
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
|
'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
2013-02-14 11:22:13 +00:00
|
|
|
|
*/
|
2011-11-22 13:34:55 +00:00
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Test MWNamespace::equals
|
|
|
|
|
|
* Note if we add a namespace registration system with keys like 'MAIN'
|
|
|
|
|
|
* we should add tests here for equivilance on things like 'MAIN' == 0
|
|
|
|
|
|
* and 'MAIN' == NS_MAIN.
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::equals
|
2011-11-22 13:34:55 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testEquals() {
|
|
|
|
|
|
$this->assertTrue( MWNamespace::equals( NS_MAIN, NS_MAIN ) );
|
|
|
|
|
|
$this->assertTrue( MWNamespace::equals( NS_MAIN, 0 ) ); // In case we make NS_MAIN 'MAIN'
|
|
|
|
|
|
$this->assertTrue( MWNamespace::equals( NS_USER, NS_USER ) );
|
|
|
|
|
|
$this->assertTrue( MWNamespace::equals( NS_USER, 2 ) );
|
|
|
|
|
|
$this->assertTrue( MWNamespace::equals( NS_USER_TALK, NS_USER_TALK ) );
|
|
|
|
|
|
$this->assertTrue( MWNamespace::equals( NS_SPECIAL, NS_SPECIAL ) );
|
|
|
|
|
|
$this->assertFalse( MWNamespace::equals( NS_MAIN, NS_TALK ) );
|
|
|
|
|
|
$this->assertFalse( MWNamespace::equals( NS_USER, NS_USER_TALK ) );
|
|
|
|
|
|
$this->assertFalse( MWNamespace::equals( NS_PROJECT, NS_TEMPLATE ) );
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::subjectEquals
|
2011-11-22 13:34:55 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testSubjectEquals() {
|
2011-12-12 15:39:01 +00:00
|
|
|
|
$this->assertSameSubject( NS_MAIN, NS_MAIN );
|
|
|
|
|
|
$this->assertSameSubject( NS_MAIN, 0 ); // In case we make NS_MAIN 'MAIN'
|
|
|
|
|
|
$this->assertSameSubject( NS_USER, NS_USER );
|
|
|
|
|
|
$this->assertSameSubject( NS_USER, 2 );
|
|
|
|
|
|
$this->assertSameSubject( NS_USER_TALK, NS_USER_TALK );
|
|
|
|
|
|
$this->assertSameSubject( NS_SPECIAL, NS_SPECIAL );
|
|
|
|
|
|
$this->assertSameSubject( NS_MAIN, NS_TALK );
|
|
|
|
|
|
$this->assertSameSubject( NS_USER, NS_USER_TALK );
|
|
|
|
|
|
|
|
|
|
|
|
$this->assertDifferentSubject( NS_PROJECT, NS_TEMPLATE );
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertDifferentSubject( NS_SPECIAL, NS_MAIN );
|
2011-12-12 15:31:48 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2013-10-24 19:35:04 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* @covers MWNamespace::subjectEquals
|
|
|
|
|
|
*/
|
2011-12-12 15:31:48 +00:00
|
|
|
|
public function testSpecialAndMediaAreDifferentSubjects() {
|
2011-12-12 15:39:01 +00:00
|
|
|
|
$this->assertDifferentSubject(
|
|
|
|
|
|
NS_MEDIA, NS_SPECIAL,
|
2011-12-12 15:47:31 +00:00
|
|
|
|
"NS_MEDIA and NS_SPECIAL are different subject namespaces"
|
2011-12-12 15:39:01 +00:00
|
|
|
|
);
|
|
|
|
|
|
$this->assertDifferentSubject(
|
|
|
|
|
|
NS_SPECIAL, NS_MEDIA,
|
2011-12-12 15:47:31 +00:00
|
|
|
|
"NS_SPECIAL and NS_MEDIA are different subject namespaces"
|
2011-12-12 15:39:01 +00:00
|
|
|
|
);
|
2011-11-22 13:34:55 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2011-02-21 22:17:06 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* @todo Implement testGetCanonicalNamespaces().
|
|
|
|
|
|
*/
|
2013-02-14 11:22:13 +00:00
|
|
|
|
/*
|
2011-02-21 22:17:06 +00:00
|
|
|
|
public function testGetCanonicalNamespaces() {
|
|
|
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
|
'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
2013-02-14 11:22:13 +00:00
|
|
|
|
*/
|
2011-02-21 22:17:06 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* @todo Implement testGetCanonicalName().
|
|
|
|
|
|
*/
|
2013-02-14 11:22:13 +00:00
|
|
|
|
/*
|
|
|
|
|
|
public function testGetCanonicalName() {
|
|
|
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
|
'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
*/
|
2011-02-21 22:17:06 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* @todo Implement testGetCanonicalIndex().
|
|
|
|
|
|
*/
|
2013-02-14 11:22:13 +00:00
|
|
|
|
/*
|
2011-02-21 22:17:06 +00:00
|
|
|
|
public function testGetCanonicalIndex() {
|
|
|
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
|
'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
2013-02-14 11:22:13 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
2011-02-21 22:17:06 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* @todo Implement testGetValidNamespaces().
|
|
|
|
|
|
*/
|
2013-02-14 11:22:13 +00:00
|
|
|
|
/*
|
2011-02-21 22:17:06 +00:00
|
|
|
|
public function testGetValidNamespaces() {
|
|
|
|
|
|
// Remove the following lines when you implement this test.
|
|
|
|
|
|
$this->markTestIncomplete(
|
|
|
|
|
|
'This test has not been implemented yet. Rely on $wgCanonicalNamespaces.'
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
2013-02-14 11:22:13 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
2011-02-21 22:17:06 +00:00
|
|
|
|
/**
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::canTalk
|
2011-02-21 22:17:06 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testCanTalk() {
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertCanNotTalk( NS_MEDIA );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertCanNotTalk( NS_SPECIAL );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertCanTalk( NS_MAIN );
|
|
|
|
|
|
$this->assertCanTalk( NS_TALK );
|
|
|
|
|
|
$this->assertCanTalk( NS_USER );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertCanTalk( NS_USER_TALK );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
|
|
|
|
|
// User defined namespaces
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertCanTalk( 100 );
|
|
|
|
|
|
$this->assertCanTalk( 101 );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::isContent
|
2011-02-21 22:17:06 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testIsContent() {
|
|
|
|
|
|
// NS_MAIN is a content namespace per DefaultSettings.php
|
|
|
|
|
|
// and per function definition.
|
|
|
|
|
|
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsContent( NS_MAIN );
|
2011-08-24 20:14:03 +00:00
|
|
|
|
|
2011-02-21 22:17:06 +00:00
|
|
|
|
// Other namespaces which are not expected to be content
|
2011-08-24 20:14:03 +00:00
|
|
|
|
|
2012-10-08 10:56:20 +00:00
|
|
|
|
$this->assertIsNotContent( NS_MEDIA );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsNotContent( NS_SPECIAL );
|
|
|
|
|
|
$this->assertIsNotContent( NS_TALK );
|
|
|
|
|
|
$this->assertIsNotContent( NS_USER );
|
|
|
|
|
|
$this->assertIsNotContent( NS_CATEGORY );
|
|
|
|
|
|
$this->assertIsNotContent( 100 );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Similar to testIsContent() but alters the $wgContentNamespaces
|
|
|
|
|
|
* global variable.
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::isContent
|
2011-02-21 22:17:06 +00:00
|
|
|
|
*/
|
2012-10-08 10:56:20 +00:00
|
|
|
|
public function testIsContentAdvanced() {
|
|
|
|
|
|
global $wgContentNamespaces;
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
2012-10-08 10:56:20 +00:00
|
|
|
|
// Test that user defined namespace #252 is not content
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsNotContent( 252 );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
|
|
|
|
|
// Bless namespace # 252 as a content namespace
|
|
|
|
|
|
$wgContentNamespaces[] = 252;
|
2012-10-08 10:56:20 +00:00
|
|
|
|
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsContent( 252 );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
|
|
|
|
|
// Makes sure NS_MAIN was not impacted
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsContent( NS_MAIN );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2013-10-24 19:35:04 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* @covers MWNamespace::isWatchable
|
|
|
|
|
|
*/
|
2011-02-21 22:17:06 +00:00
|
|
|
|
public function testIsWatchable() {
|
|
|
|
|
|
// Specials namespaces are not watchable
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsNotWatchable( NS_MEDIA );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsNotWatchable( NS_SPECIAL );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
|
|
|
|
|
// Core defined namespaces are watchables
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsWatchable( NS_MAIN );
|
|
|
|
|
|
$this->assertIsWatchable( NS_TALK );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
|
|
|
|
|
// Additional, user defined namespaces are watchables
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsWatchable( 100 );
|
|
|
|
|
|
$this->assertIsWatchable( 101 );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2013-10-24 19:35:04 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* @covers MWNamespace::hasSubpages
|
|
|
|
|
|
*/
|
2011-02-21 22:17:06 +00:00
|
|
|
|
public function testHasSubpages() {
|
2012-10-08 10:56:20 +00:00
|
|
|
|
global $wgNamespacesWithSubpages;
|
|
|
|
|
|
|
2011-02-21 22:17:06 +00:00
|
|
|
|
// Special namespaces:
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertHasNotSubpages( NS_MEDIA );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertHasNotSubpages( NS_SPECIAL );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
2012-10-08 10:56:20 +00:00
|
|
|
|
// Namespaces without subpages
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertHasNotSubpages( NS_MAIN );
|
2011-08-15 14:17:45 +00:00
|
|
|
|
|
|
|
|
|
|
$wgNamespacesWithSubpages[NS_MAIN] = true;
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertHasSubpages( NS_MAIN );
|
2012-10-08 10:56:20 +00:00
|
|
|
|
|
2011-08-15 14:17:45 +00:00
|
|
|
|
$wgNamespacesWithSubpages[NS_MAIN] = false;
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertHasNotSubpages( NS_MAIN );
|
2011-08-15 14:17:45 +00:00
|
|
|
|
|
2011-02-21 22:17:06 +00:00
|
|
|
|
// Some namespaces with subpages
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertHasSubpages( NS_TALK );
|
|
|
|
|
|
$this->assertHasSubpages( NS_USER );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertHasSubpages( NS_USER_TALK );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::getContentNamespaces
|
2011-02-21 22:17:06 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testGetContentNamespaces() {
|
2012-10-08 10:56:20 +00:00
|
|
|
|
global $wgContentNamespaces;
|
|
|
|
|
|
|
2011-02-21 22:17:06 +00:00
|
|
|
|
$this->assertEquals(
|
2011-08-24 19:32:40 +00:00
|
|
|
|
array( NS_MAIN ),
|
2013-03-22 16:44:34 +00:00
|
|
|
|
MWNamespace::getContentNamespaces(),
|
2011-02-21 22:17:06 +00:00
|
|
|
|
'$wgContentNamespaces is an array with only NS_MAIN by default'
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
# test !is_array( $wgcontentNamespaces )
|
|
|
|
|
|
$wgContentNamespaces = '';
|
2013-07-04 19:55:47 +00:00
|
|
|
|
$this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() );
|
2012-10-08 10:56:20 +00:00
|
|
|
|
|
2011-02-21 22:17:06 +00:00
|
|
|
|
$wgContentNamespaces = false;
|
2013-07-04 19:55:47 +00:00
|
|
|
|
$this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() );
|
2012-10-08 10:56:20 +00:00
|
|
|
|
|
2011-02-21 22:17:06 +00:00
|
|
|
|
$wgContentNamespaces = null;
|
2013-07-04 19:55:47 +00:00
|
|
|
|
$this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() );
|
2012-10-08 10:56:20 +00:00
|
|
|
|
|
2011-02-21 22:17:06 +00:00
|
|
|
|
$wgContentNamespaces = 5;
|
2013-07-04 19:55:47 +00:00
|
|
|
|
$this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
2011-08-24 19:32:40 +00:00
|
|
|
|
# test $wgContentNamespaces === array()
|
2011-02-21 22:17:06 +00:00
|
|
|
|
$wgContentNamespaces = array();
|
2013-07-04 19:55:47 +00:00
|
|
|
|
$this->assertEquals( array( NS_MAIN ), MWNamespace::getContentNamespaces() );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
|
|
|
|
|
# test !in_array( NS_MAIN, $wgContentNamespaces )
|
|
|
|
|
|
$wgContentNamespaces = array( NS_USER, NS_CATEGORY );
|
|
|
|
|
|
$this->assertEquals(
|
|
|
|
|
|
array( NS_MAIN, NS_USER, NS_CATEGORY ),
|
2013-03-22 16:44:34 +00:00
|
|
|
|
MWNamespace::getContentNamespaces(),
|
2011-12-31 21:25:00 +00:00
|
|
|
|
'NS_MAIN is forced in $wgContentNamespaces even if unwanted'
|
2011-02-21 22:17:06 +00:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
# test other cases, return $wgcontentNamespaces as is
|
|
|
|
|
|
$wgContentNamespaces = array( NS_MAIN );
|
|
|
|
|
|
$this->assertEquals(
|
2011-08-24 19:32:40 +00:00
|
|
|
|
array( NS_MAIN ),
|
2013-03-22 16:44:34 +00:00
|
|
|
|
MWNamespace::getContentNamespaces()
|
2011-02-21 22:17:06 +00:00
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
$wgContentNamespaces = array( NS_MAIN, NS_USER, NS_CATEGORY );
|
|
|
|
|
|
$this->assertEquals(
|
2011-08-24 19:32:40 +00:00
|
|
|
|
array( NS_MAIN, NS_USER, NS_CATEGORY ),
|
2013-03-22 16:44:34 +00:00
|
|
|
|
MWNamespace::getContentNamespaces()
|
2011-02-21 22:17:06 +00:00
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2012-06-26 14:45:06 +00:00
|
|
|
|
/**
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::getSubjectNamespaces
|
2012-06-26 14:45:06 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testGetSubjectNamespaces() {
|
|
|
|
|
|
$subjectsNS = MWNamespace::getSubjectNamespaces();
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertContains( NS_MAIN, $subjectsNS,
|
2012-06-26 14:45:06 +00:00
|
|
|
|
"Talk namespaces should have NS_MAIN" );
|
|
|
|
|
|
$this->assertNotContains( NS_TALK, $subjectsNS,
|
|
|
|
|
|
"Talk namespaces should have NS_TALK" );
|
|
|
|
|
|
|
|
|
|
|
|
$this->assertNotContains( NS_MEDIA, $subjectsNS,
|
|
|
|
|
|
"Talk namespaces should not have NS_MEDIA" );
|
|
|
|
|
|
$this->assertNotContains( NS_SPECIAL, $subjectsNS,
|
|
|
|
|
|
"Talk namespaces should not have NS_SPECIAL" );
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::getTalkNamespaces
|
2012-06-26 14:45:06 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testGetTalkNamespaces() {
|
|
|
|
|
|
$talkNS = MWNamespace::getTalkNamespaces();
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertContains( NS_TALK, $talkNS,
|
2012-06-26 14:45:06 +00:00
|
|
|
|
"Subject namespaces should have NS_TALK" );
|
|
|
|
|
|
$this->assertNotContains( NS_MAIN, $talkNS,
|
|
|
|
|
|
"Subject namespaces should not have NS_MAIN" );
|
|
|
|
|
|
|
|
|
|
|
|
$this->assertNotContains( NS_MEDIA, $talkNS,
|
|
|
|
|
|
"Subject namespaces should not have NS_MEDIA" );
|
|
|
|
|
|
$this->assertNotContains( NS_SPECIAL, $talkNS,
|
|
|
|
|
|
"Subject namespaces should not have NS_SPECIAL" );
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2011-02-21 22:17:06 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* Some namespaces are always capitalized per code definition
|
|
|
|
|
|
* in MWNamespace::$alwaysCapitalizedNamespaces
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::isCapitalized
|
2011-02-21 22:17:06 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testIsCapitalizedHardcodedAssertions() {
|
|
|
|
|
|
// NS_MEDIA and NS_FILE are treated the same
|
|
|
|
|
|
$this->assertEquals(
|
|
|
|
|
|
MWNamespace::isCapitalized( NS_MEDIA ),
|
2013-02-14 11:22:13 +00:00
|
|
|
|
MWNamespace::isCapitalized( NS_FILE ),
|
2011-02-21 22:17:06 +00:00
|
|
|
|
'NS_MEDIA and NS_FILE have same capitalization rendering'
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
// Boths are capitalized by default
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsCapitalized( NS_MEDIA );
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsCapitalized( NS_FILE );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
|
|
|
|
|
// Always capitalized namespaces
|
|
|
|
|
|
// @see MWNamespace::$alwaysCapitalizedNamespaces
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsCapitalized( NS_SPECIAL );
|
|
|
|
|
|
$this->assertIsCapitalized( NS_USER );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsCapitalized( NS_MEDIAWIKI );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Follows up for testIsCapitalizedHardcodedAssertions() but alter the
|
|
|
|
|
|
* global $wgCapitalLink setting to have extended coverage.
|
|
|
|
|
|
*
|
|
|
|
|
|
* MWNamespace::isCapitalized() rely on two global settings:
|
|
|
|
|
|
* $wgCapitalLinkOverrides = array(); by default
|
|
|
|
|
|
* $wgCapitalLinks = true; by default
|
|
|
|
|
|
* This function test $wgCapitalLinks
|
2012-10-26 15:42:13 +00:00
|
|
|
|
*
|
2011-02-21 22:17:06 +00:00
|
|
|
|
* Global setting correctness is tested against the NS_PROJECT and
|
|
|
|
|
|
* NS_PROJECT_TALK namespaces since they are not hardcoded nor specials
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::isCapitalized
|
2011-02-21 22:17:06 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testIsCapitalizedWithWgCapitalLinks() {
|
|
|
|
|
|
global $wgCapitalLinks;
|
|
|
|
|
|
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsCapitalized( NS_PROJECT );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsCapitalized( NS_PROJECT_TALK );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
|
|
|
|
|
$wgCapitalLinks = false;
|
2012-10-08 10:56:20 +00:00
|
|
|
|
|
2011-02-21 22:17:06 +00:00
|
|
|
|
// hardcoded namespaces (see above function) are still capitalized:
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsCapitalized( NS_SPECIAL );
|
|
|
|
|
|
$this->assertIsCapitalized( NS_USER );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsCapitalized( NS_MEDIAWIKI );
|
2012-10-08 10:56:20 +00:00
|
|
|
|
|
2011-02-21 22:17:06 +00:00
|
|
|
|
// setting is correctly applied
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsNotCapitalized( NS_PROJECT );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsNotCapitalized( NS_PROJECT_TALK );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* Counter part for MWNamespace::testIsCapitalizedWithWgCapitalLinks() now
|
|
|
|
|
|
* testing the $wgCapitalLinkOverrides global.
|
|
|
|
|
|
*
|
|
|
|
|
|
* @todo split groups of assertions in autonomous testing functions
|
2013-10-24 19:35:04 +00:00
|
|
|
|
* @covers MWNamespace::isCapitalized
|
2011-02-21 22:17:06 +00:00
|
|
|
|
*/
|
|
|
|
|
|
public function testIsCapitalizedWithWgCapitalLinkOverrides() {
|
|
|
|
|
|
global $wgCapitalLinkOverrides;
|
|
|
|
|
|
|
|
|
|
|
|
// Test default settings
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsCapitalized( NS_PROJECT );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsCapitalized( NS_PROJECT_TALK );
|
2012-10-08 10:56:20 +00:00
|
|
|
|
|
2011-02-21 22:17:06 +00:00
|
|
|
|
// hardcoded namespaces (see above function) are capitalized:
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsCapitalized( NS_SPECIAL );
|
|
|
|
|
|
$this->assertIsCapitalized( NS_USER );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsCapitalized( NS_MEDIAWIKI );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
|
|
|
|
|
// Hardcoded namespaces remains capitalized
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$wgCapitalLinkOverrides[NS_SPECIAL] = false;
|
|
|
|
|
|
$wgCapitalLinkOverrides[NS_USER] = false;
|
2011-02-21 22:17:06 +00:00
|
|
|
|
$wgCapitalLinkOverrides[NS_MEDIAWIKI] = false;
|
2012-10-08 10:56:20 +00:00
|
|
|
|
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertIsCapitalized( NS_SPECIAL );
|
|
|
|
|
|
$this->assertIsCapitalized( NS_USER );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsCapitalized( NS_MEDIAWIKI );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
|
|
|
|
|
$wgCapitalLinkOverrides[NS_PROJECT] = false;
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsNotCapitalized( NS_PROJECT );
|
2012-10-08 10:56:20 +00:00
|
|
|
|
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$wgCapitalLinkOverrides[NS_PROJECT] = true;
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$this->assertIsCapitalized( NS_PROJECT );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
|
2012-10-08 10:56:20 +00:00
|
|
|
|
unset( $wgCapitalLinkOverrides[NS_PROJECT] );
|
|
|
|
|
|
$this->assertIsCapitalized( NS_PROJECT );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2013-10-24 19:35:04 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* @covers MWNamespace::hasGenderDistinction
|
|
|
|
|
|
*/
|
2011-02-21 22:17:06 +00:00
|
|
|
|
public function testHasGenderDistinction() {
|
|
|
|
|
|
// Namespaces with gender distinctions
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertTrue( MWNamespace::hasGenderDistinction( NS_USER ) );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
$this->assertTrue( MWNamespace::hasGenderDistinction( NS_USER_TALK ) );
|
|
|
|
|
|
|
|
|
|
|
|
// Other ones, "genderless"
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertFalse( MWNamespace::hasGenderDistinction( NS_MEDIA ) );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
$this->assertFalse( MWNamespace::hasGenderDistinction( NS_SPECIAL ) );
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$this->assertFalse( MWNamespace::hasGenderDistinction( NS_MAIN ) );
|
|
|
|
|
|
$this->assertFalse( MWNamespace::hasGenderDistinction( NS_TALK ) );
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|
2011-12-12 15:02:47 +00:00
|
|
|
|
|
2013-10-24 19:35:04 +00:00
|
|
|
|
/**
|
|
|
|
|
|
* @covers MWNamespace::isNonincludable
|
|
|
|
|
|
*/
|
2012-05-11 17:52:34 +00:00
|
|
|
|
public function testIsNonincludable() {
|
|
|
|
|
|
global $wgNonincludableNamespaces;
|
2012-10-08 10:56:20 +00:00
|
|
|
|
|
2012-05-11 17:52:34 +00:00
|
|
|
|
$wgNonincludableNamespaces = array( NS_USER );
|
|
|
|
|
|
|
|
|
|
|
|
$this->assertTrue( MWNamespace::isNonincludable( NS_USER ) );
|
|
|
|
|
|
$this->assertFalse( MWNamespace::isNonincludable( NS_TEMPLATE ) );
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2011-12-12 15:02:47 +00:00
|
|
|
|
####### HELPERS ###########################################################
|
|
|
|
|
|
function __call( $method, $args ) {
|
|
|
|
|
|
// Call the real method if it exists
|
2013-02-14 11:22:13 +00:00
|
|
|
|
if ( method_exists( $this, $method ) ) {
|
2011-12-12 15:02:47 +00:00
|
|
|
|
return $this->$method( $args );
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-04-24 10:05:52 +00:00
|
|
|
|
if ( preg_match(
|
|
|
|
|
|
'/^assert(Has|Is|Can)(Not|)(Subject|Talk|Watchable|Content|Subpages|Capitalized)$/',
|
|
|
|
|
|
$method,
|
|
|
|
|
|
$m
|
|
|
|
|
|
) ) {
|
2011-12-12 15:02:47 +00:00
|
|
|
|
# Interprets arguments:
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$ns = $args[0];
|
|
|
|
|
|
$msg = isset( $args[1] ) ? $args[1] : " dummy message";
|
2011-12-12 15:02:47 +00:00
|
|
|
|
|
|
|
|
|
|
# Forge the namespace constant name:
|
2013-02-14 11:22:13 +00:00
|
|
|
|
if ( $ns === 0 ) {
|
2011-12-12 15:26:12 +00:00
|
|
|
|
$ns_name = "NS_MAIN";
|
|
|
|
|
|
} else {
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$ns_name = "NS_" . strtoupper( MWNamespace::getCanonicalName( $ns ) );
|
2011-12-12 15:26:12 +00:00
|
|
|
|
}
|
2011-12-12 15:02:47 +00:00
|
|
|
|
# ... and the MWNamespace method name
|
|
|
|
|
|
$nsMethod = strtolower( $m[1] ) . $m[3];
|
|
|
|
|
|
|
2013-02-14 11:22:13 +00:00
|
|
|
|
$expect = ( $m[2] === '' );
|
2011-12-12 15:02:47 +00:00
|
|
|
|
$expect_name = $expect ? 'TRUE' : 'FALSE';
|
|
|
|
|
|
|
|
|
|
|
|
return $this->assertEquals( $expect,
|
|
|
|
|
|
MWNamespace::$nsMethod( $ns, $msg ),
|
|
|
|
|
|
"MWNamespace::$nsMethod( $ns_name ) should returns $expect_name"
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
throw new Exception( __METHOD__ . " could not find a method named $method\n" );
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2011-12-12 15:39:01 +00:00
|
|
|
|
function assertSameSubject( $ns1, $ns2, $msg = '' ) {
|
|
|
|
|
|
$this->assertTrue( MWNamespace::subjectEquals( $ns1, $ns2, $msg ) );
|
|
|
|
|
|
}
|
2013-02-14 11:22:13 +00:00
|
|
|
|
|
2011-12-12 15:39:01 +00:00
|
|
|
|
function assertDifferentSubject( $ns1, $ns2, $msg = '' ) {
|
|
|
|
|
|
$this->assertFalse( MWNamespace::subjectEquals( $ns1, $ns2, $msg ) );
|
|
|
|
|
|
}
|
2011-02-21 22:17:06 +00:00
|
|
|
|
}
|