summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2015-01-06 17:06:22 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2015-01-06 17:07:24 +0100
commit4ea127ed03feeae1ace8f38b60466bf842528fb1 (patch)
tree41b37e6e26285a1694b6395a34fc8d87e12e10f3 /tests
parentc8cf0c1be89388c950310ca8af627bc696841288 (diff)
set noreferrer tag for links pointing to articles
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/articleenhancer/XPathArticleEnhancerTest.php6
-rw-r--r--tests/unit/db/ItemTest.php2
2 files changed, 4 insertions, 4 deletions
diff --git a/tests/unit/articleenhancer/XPathArticleEnhancerTest.php b/tests/unit/articleenhancer/XPathArticleEnhancerTest.php
index 2d207d177..77c5ef2e7 100644
--- a/tests/unit/articleenhancer/XPathArticleEnhancerTest.php
+++ b/tests/unit/articleenhancer/XPathArticleEnhancerTest.php
@@ -181,10 +181,10 @@ class XPathArticleEnhancerTest extends \PHPUnit_Framework_TestCase {
$result = $this->testEnhancer->enhance($item);
$this->assertEquals('<div>' .
- '<a target="_blank" ' .
+ '<a target="_blank" rel="noreferrer" ' .
'href="https://www.explosm.net/a/relative/url.html?a=1#b">' .
'link</a>' .
- '<a target="_blank" ' .
+ '<a target="_blank" rel="noreferrer" ' .
'href="https://www.explosm.net/all/b/relative/url.html">' .
'link2</a>' .
'<img src="https://www.explosm.net/another/relative/link.jpg">' .
@@ -230,7 +230,7 @@ class XPathArticleEnhancerTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals(
'<div>' .
'<img src="http://www.url.com/absolute/url.png">' .
- '<a target="_blank" href="mailto:test@testsite.com">mail</a>' .
+ '<a target="_blank" rel="noreferrer" href="mailto:test@testsite.com">mail</a>' .
'</div>',
$result->getBody()
);
diff --git a/tests/unit/db/ItemTest.php b/tests/unit/db/ItemTest.php
index 4ced884c8..c937053d1 100644
--- a/tests/unit/db/ItemTest.php
+++ b/tests/unit/db/ItemTest.php
@@ -264,7 +264,7 @@ class ItemTest extends \PHPUnit_Framework_TestCase {
public function testMakeLinksInBodyOpenNewTab() {
$item = new Item();
$item->setBody("<a href=\"test\">ha</a>");
- $this->assertEquals("<a target=\"_blank\" href=\"test\">ha</a>",
+ $this->assertEquals("<a target=\"_blank\" rel=\"noreferrer\" href=\"test\">ha</a>",
$item->getBody());
}