Go to the documentation of this file.
14 'wgContentNamespaces' => [
NS_MAIN ],
15 'wgNamespacesWithSubpages' => [
20 'wgCapitalLinks' =>
true,
21 'wgCapitalLinkOverrides' => [],
22 'wgNonincludableNamespaces' => [],
147 # ## Exceptions with getAssociated()
148 # ## NS_MEDIA and NS_SPECIAL do not have talk pages. MediaWiki raises
149 # ## an exception for them.
208 "NS_MEDIA and NS_SPECIAL are different subject namespaces"
212 "NS_SPECIAL and NS_MEDIA are different subject namespaces"
240 $this->assertSame( $actual, $expected,
"NS $index" );
253 $this->assertSame( $actual, $expected,
"NS $index" );
295 $wgContentNamespaces[] = 252;
349 $wgNamespacesWithSubpages[
NS_MAIN] =
true;
352 $wgNamespacesWithSubpages[
NS_MAIN] =
false;
370 '$wgContentNamespaces is an array with only NS_MAIN by default'
373 # test !is_array( $wgcontentNamespaces )
386 # test $wgContentNamespaces === []
390 # test !in_array( NS_MAIN, $wgContentNamespaces )
395 'NS_MAIN is forced in $wgContentNamespaces even if unwanted'
398 # test other cases, return $wgcontentNamespaces as is
417 $this->assertContains(
NS_MAIN, $subjectsNS,
418 "Talk namespaces should have NS_MAIN" );
419 $this->assertNotContains(
NS_TALK, $subjectsNS,
420 "Talk namespaces should have NS_TALK" );
422 $this->assertNotContains(
NS_MEDIA, $subjectsNS,
423 "Talk namespaces should not have NS_MEDIA" );
424 $this->assertNotContains(
NS_SPECIAL, $subjectsNS,
425 "Talk namespaces should not have NS_SPECIAL" );
433 $this->assertContains(
NS_TALK, $talkNS,
434 "Subject namespaces should have NS_TALK" );
435 $this->assertNotContains(
NS_MAIN, $talkNS,
436 "Subject namespaces should not have NS_MAIN" );
438 $this->assertNotContains(
NS_MEDIA, $talkNS,
439 "Subject namespaces should not have NS_MEDIA" );
440 $this->assertNotContains(
NS_SPECIAL, $talkNS,
441 "Subject namespaces should not have NS_SPECIAL" );
462 'NS_MEDIA and NS_FILE have same capitalization rendering'
495 $wgCapitalLinks =
false;
607 $this->assertSame( $expected, $actual,
"NS $index" );
$wgNonincludableNamespaces
Pages in namespaces in this array can not be used as templates.
testIsContentAdvanced()
Similar to testIsContent() but alters the $wgContentNamespaces global variable.
testSubjectEquals()
MWNamespace::subjectEquals.
static subjectEquals( $ns1, $ns2)
Returns whether the specified namespaces share the same subject.
static isNonincludable( $index)
It is not possible to use pages from this namespace as template?
processing should stop and the error should be shown to the user * false
assertIsNotWatchable( $ns)
assertDifferentSubject( $ns1, $ns2, $msg='')
static hasGenderDistinction( $index)
Does the namespace (potentially) have different aliases for different genders.
static isTalk( $index)
Is the given namespace a talk namespace?
static getTalkNamespaces()
List all namespace indices which are considered talks, aka not a subject or special namespace.
testGetSubjectNamespaces()
MWNamespace::getSubjectNamespaces.
testGetAssociated()
Regular getAssociated() calls Namespaces without an associated page (NS_MEDIA, NS_SPECIAL) are tested...
testGetContentNamespaces()
MWNamespace::getContentNamespaces.
testHasTalkNamespace( $index, $expected)
provideHasTalkNamespace MWNamespace::hasTalkNamespace
testIsNonincludable()
MWNamespace::isNonincludable.
testIsSubject()
Please make sure to change testIsTalk() if you change the assertions below MWNamespace::isSubject.
provideHasTalkNamespace()
assertIsNotCapitalized( $ns)
testGetSubject()
MWNamespace::getSubject.
testIsCapitalizedWithWgCapitalLinks()
Follows up for testIsCapitalizedHardcodedAssertions() but alter the global $wgCapitalLink setting to ...
static getSubjectNamespaces()
List all namespace indices which are considered subject, aka not a talk or special namespace.
testSpecialAndMediaAreDifferentSubjects()
MWNamespace::subjectEquals.
static getContentNamespaces()
Get a list of all namespace indices which are considered to contain content.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
testCanTalk( $index, $expected)
provideHasTalkNamespace MWNamespace::canTalk
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such and we might be restricted by PHP settings such as safe mode or open_basedir We cannot assume that the software even has read access anywhere useful Many shared hosts run all users web applications under the same user
assertHasNotSubpages( $ns)
static canTalk( $index)
Does this namespace ever have a talk namespace?
testIsTalk()
Reverse of testIsSubject().
static isContent( $index)
Does this namespace contain content, for the purposes of calculating statistics, etc?
static hasTalkNamespace( $index)
Does this namespace ever have a talk namespace?
static hasSubpages( $index)
Does the namespace allow subpages?
testGetTalkNamespaces()
MWNamespace::getTalkNamespaces.
testIsWatchable()
MWNamespace::isWatchable.
static isMovable( $index)
Can pages in the given namespace be moved?
assertSameSubject( $ns1, $ns2, $msg='')
static isSubject( $index)
Is the given namespace is a subject (non-talk) namespace?
testEquals()
Test MWNamespace::equals Note if we add a namespace registration system with keys like 'MAIN' we shou...
testGetAssociatedExceptionsForNsMedia()
MWException MWNamespace::getAssociated.
testIsCapitalizedHardcodedAssertions()
Some namespaces are always capitalized per code definition in MWNamespace::$alwaysCapitalizedNamespac...
testGetTalkExceptionsForNsMedia()
Exceptions with getTalk() NS_MEDIA does not have talk pages.
testGetCategoryLinkType( $index, $expected)
provideGetCategoryLinkType MWNamespace::getCategoryLinkType
$wgContentNamespaces
Array of namespaces which can be deemed to contain valid "content", as far as the site statistics are...
testIsCapitalizedWithWgCapitalLinkOverrides()
Counter part for MWNamespace::testIsCapitalizedWithWgCapitalLinks() now testing the $wgCapitalLinkOve...
testGetTalkExceptionsForNsSpecial()
Exceptions with getTalk() NS_SPECIAL does not have talk pages.
$wgCapitalLinks
Set this to false to avoid forcing the first letter of links to capitals.
static equals( $ns1, $ns2)
Returns whether the specified namespaces are the same namespace.
static getCategoryLinkType( $index)
Returns the link type to be used for categories.
static isCapitalized( $index)
Is the namespace first-letter capitalized?
provideGetCategoryLinkType()
testHasSubpages()
MWNamespace::hasSubpages.
assertIsCapitalized( $ns)
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
static isWatchable( $index)
Can pages in a namespace be watched?
static getTalk( $index)
Get the talk namespace index for a given namespace.
testGetTalk()
Regular getTalk() calls Namespaces without a talk page (NS_MEDIA, NS_SPECIAL) are tested in the funct...
static getSubject( $index)
Get the subject namespace index for a given namespace Special namespaces (NS_MEDIA,...
$wgNamespacesWithSubpages
Which namespaces should support subpages? See Language.php for a list of namespaces.
testGetAssociatedExceptionsForNsSpecial()
MWException MWNamespace::getAssociated.
testIsContent()
MWNamespace::isContent.
static getAssociated( $index)
Get the associated namespace.
testHasGenderDistinction()
MWNamespace::hasGenderDistinction.