14ini_set(
'include_path', ini_get(
'include_path' ) .
':' .
15 __DIR__ .
'/../../../tests/phpunit/includes/api' );
31 'src' => __DIR__ .
'/testSource',
46 'action' =>
'titleblacklist',
48 'tbtitle' =>
'evil_acc',
49 'tbaction' =>
'create',
50 'tbnooverride' =>
true,
55 $unlisted[0][
'titleblacklist'][
'result'],
56 'Not blacklisted title returns ok'
68 $wgGroupPermissions[
'*'][
'tboverride'] =
true;
71 'action' =>
'titleblacklist',
73 'tbaction' =>
'create',
78 $unlisted[0][
'titleblacklist'][
'result'],
79 'Blacklisted title returns ok if the user is allowd to tboverride'
88 'action' =>
'titleblacklist',
90 'tbaction' =>
'create',
91 'tbnooverride' =>
true,
96 $listed[0][
'titleblacklist'][
'result'],
97 'Listed title returns error'
100 "The title \"bar\" has been banned from creation.\nIt matches the following " .
101 "blacklist entry: <code>[Bb]ar #example blacklist entry</code>",
102 $listed[0][
'titleblacklist'][
'reason'],
103 'Listed title error text is as expected'
107 "titleblacklist-forbidden-edit",
108 $listed[0][
'titleblacklist'][
'message'],
109 'Correct blacklist message name is returned'
113 "[Bb]ar #example blacklist entry",
114 $listed[0][
'titleblacklist'][
'line'],
115 'Correct blacklist line is returned'
123 if ( !class_exists(
'AntiSpoof' ) ) {
124 $this->markTestSkipped(
"This test requires the AntiSpoof extension" );
128 'action' =>
'titleblacklist',
129 'tbtitle' =>
'AVVVV',
130 'tbaction' =>
'create',
131 'tbnooverride' =>
true,
136 $listed[0][
'titleblacklist'][
'result'],
137 'Spoofed title is blacklisted'
$wgGroupPermissions['sysop']['replacetext']
medium ApiQueryTitleBlacklist
testAntiSpoofIntegration()
Tests integration with the AntiSpoof extension.
testCheckingUnlistedTitle()
Verify we allow a title which is not blacklisted.
testCheckingBlackListedTitle()
Verify a blacklisted title gives out an error.
testTboverride()
Verify tboverride works.
doLogin( $testUser=null)
Previously this would do API requests to log in, as well as setting $wgUser and the request context's...
doApiRequest(array $params, array $session=null, $appendModule=false, User $user=null, $tokenType=null)
Does the API request and returns the result.
static destroySingleton()
Destroy/reset the current singleton instance.