Go to the documentation of this file.
14 ini_set(
'include_path', ini_get(
'include_path' ) .
':' .
15 __DIR__ .
'/../../../tests/phpunit/includes/api' );
30 'src' => __DIR__ .
'/testSource',
45 'action' =>
'titleblacklist',
47 'tbtitle' =>
'evil_acc',
48 'tbaction' =>
'create',
49 'tbnooverride' =>
true,
54 $unlisted[0][
'titleblacklist'][
'result'],
55 'Not blacklisted title returns ok'
67 $wgGroupPermissions[
'*'][
'tboverride'] =
true;
70 'action' =>
'titleblacklist',
72 'tbaction' =>
'create',
77 $unlisted[0][
'titleblacklist'][
'result'],
78 'Blacklisted title returns ok if the user is allowd to tboverride'
87 'action' =>
'titleblacklist',
89 'tbaction' =>
'create',
90 'tbnooverride' =>
true,
95 $listed[0][
'titleblacklist'][
'result'],
96 'Listed title returns error'
99 "The title \"bar\" has been banned from creation.\nIt matches the following " .
100 "blacklist entry: <code>[Bb]ar #example blacklist entry</code>",
101 $listed[0][
'titleblacklist'][
'reason'],
102 'Listed title error text is as expected'
106 "titleblacklist-forbidden-edit",
107 $listed[0][
'titleblacklist'][
'message'],
108 'Correct blacklist message name is returned'
112 "[Bb]ar #example blacklist entry",
113 $listed[0][
'titleblacklist'][
'line'],
114 'Correct blacklist line is returned'
122 if ( !class_exists(
'AntiSpoof' ) ) {
123 $this->markTestSkipped(
"This test requires the AntiSpoof extension" );
127 'action' =>
'titleblacklist',
128 'tbtitle' =>
'AVVVV',
129 'tbaction' =>
'create',
130 'tbnooverride' =>
true,
135 $listed[0][
'titleblacklist'][
'result'],
136 'Spoofed title is blacklisted'
testCheckingBlackListedTitle()
Verify a blacklisted title gives out an error.
static destroySingleton()
Destroy/reset the current singleton instance.
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
testAntiSpoofIntegration()
Tests integration with the AntiSpoof extension.
testCheckingUnlistedTitle()
Verify we allow a title which is not blacklisted.
when a variable name is used in a it is silently declared as a new masking the global
doLogin( $testUser='sysop')
testTboverride()
Verify tboverride works.
doApiRequest(array $params, array $session=null, $appendModule=false, User $user=null)
Does the API request and returns the result.
$wgGroupPermissions
Permission keys given to users in each group.