25 $this->setMwGlobals(
'wgTitleBlacklistSources', [
28 'src' => __DIR__ .
'/testSource',
42 $unlisted = $this->doApiRequest( [
43 'action' =>
'titleblacklist',
45 'tbtitle' =>
'evil_acc',
46 'tbaction' =>
'create',
47 'tbnooverride' =>
true,
52 $unlisted[0][
'titleblacklist'][
'result'],
53 'Not blacklisted title returns ok'
62 $this->setGroupPermissions(
'*',
'tboverride',
true );
64 $unlisted = $this->doApiRequest( [
65 'action' =>
'titleblacklist',
67 'tbaction' =>
'create',
72 $unlisted[0][
'titleblacklist'][
'result'],
73 'Blacklisted title returns ok if the user is allowd to tboverride'
81 $listed = $this->doApiRequest( [
82 'action' =>
'titleblacklist',
84 'tbaction' =>
'create',
85 'tbnooverride' =>
true,
90 $listed[0][
'titleblacklist'][
'result'],
91 'Listed title returns error'
94 "The title \"bar\" has been banned from creation.\nIt matches the following " .
95 "blacklist entry: <code>[Bb]ar #example blacklist entry</code>",
96 $listed[0][
'titleblacklist'][
'reason'],
97 'Listed title error text is as expected'
101 "titleblacklist-forbidden-edit",
102 $listed[0][
'titleblacklist'][
'message'],
103 'Correct blacklist message name is returned'
107 "[Bb]ar #example blacklist entry",
108 $listed[0][
'titleblacklist'][
'line'],
109 'Correct blacklist line is returned'
118 $this->markTestSkipped(
"This test requires the AntiSpoof extension" );
121 $listed = $this->doApiRequest( [
122 'action' =>
'titleblacklist',
123 'tbtitle' =>
'AVVVV',
124 'tbaction' =>
'create',
125 'tbnooverride' =>
true,
130 $listed[0][
'titleblacklist'][
'result'],
131 'Spoofed title is blacklisted'