From: Kunal Mehta
Date: Wed, 1 Jun 2016 05:20:36 +0000 (-0700)
Subject: Add a parser test for $wgNoFollowDomainExceptions functionality
X-Git-Tag: 1.31.0-rc.0~6740^2~1
X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/Boston?a=commitdiff_plain;h=ee5078708aabc4688ed94f1e2b9f620b4f3962ab;p=lhc%2Fweb%2Fwiklou.git
Add a parser test for $wgNoFollowDomainExceptions functionality
Verify that domains on the exception list don't get a "nofollow"
attribute.
Change-Id: I01a7fc0fd9ccd21069beb26dcf3f775c79e00202
---
diff --git a/tests/parser/parserTest.inc b/tests/parser/parserTest.inc
index c2bb78d82c..132743f32d 100644
--- a/tests/parser/parserTest.inc
+++ b/tests/parser/parserTest.inc
@@ -891,7 +891,7 @@ class ParserTest {
'wgMaxTocLevel' => $maxtoclevel,
'wgCapitalLinks' => true,
'wgNoFollowLinks' => true,
- 'wgNoFollowDomainExceptions' => [],
+ 'wgNoFollowDomainExceptions' => [ 'no-nofollow.org' ],
'wgThumbnailScriptPath' => false,
'wgUseImageResize' => true,
'wgSVGConverter' => 'null',
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index 523953c1d4..2f5450c91c 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -4782,6 +4782,15 @@ ok-http://exam
!! end
+!! test
+External links: nofollow domain exception
+!! wikitext
+A [https://no-nofollow.org/foobar link], and another [https://example.org link].
+!! html
+A link, and another link.
+
+!!end
+
!! test
External image
!! wikitext
diff --git a/tests/phpunit/includes/parser/NewParserTest.php b/tests/phpunit/includes/parser/NewParserTest.php
index c024555a2c..354ddd4fc6 100644
--- a/tests/phpunit/includes/parser/NewParserTest.php
+++ b/tests/phpunit/includes/parser/NewParserTest.php
@@ -94,7 +94,7 @@ class NewParserTest extends MediaWikiTestCase {
$tmpGlobals['wgParserCacheType'] = CACHE_NONE;
$tmpGlobals['wgCapitalLinks'] = true;
$tmpGlobals['wgNoFollowLinks'] = true;
- $tmpGlobals['wgNoFollowDomainExceptions'] = [];
+ $tmpGlobals['wgNoFollowDomainExceptions'] = [ 'no-nofollow.org' ];
$tmpGlobals['wgExternalLinkTarget'] = false;
$tmpGlobals['wgThumbnailScriptPath'] = false;
$tmpGlobals['wgUseImageResize'] = true;