24 protected $blacklist = [
'\b01bags\.com\b',
'sytes\.net' ];
40 [
'https://example.com' ],
43 'revision with spam, with additional non-spam' => [
44 [
'https://foo.com',
'http://01bags.com',
'http://bar.com' ],
48 'revision with spam using full width stop normalization' => [
49 [
'http://01bags.com' ],
53 'revision with domain blacklisted as spam, but subdomain whitelisted' => [
54 [
'http://a5b.sytes.net' ],
63 public function testSpam( $links, $expected ) {
65 $this->assertEquals( $expected, $returnValue );
74 $this->setMwGlobals(
'wgBlacklistSettings', [
79 $this->insertPage(
'MediaWiki:Spam-blacklist', implode(
"\n", $this->blacklist ) );
80 $this->insertPage(
'MediaWiki:Spam-whitelist', implode(
"\n", $this->whitelist ) );
84 $reflProp = new \ReflectionProperty( $instance,
'regexes' );
85 $reflProp->setAccessible(
true );
86 $reflProp->setValue( $instance,
false );