Fix in AttrTransform_Nofollow
[htmlpurifier.git] / tests / HTMLPurifier / HTMLModule / NofollowTest.php
blob90e15313660433cc682f0fe65365056d7ee9b461
1 <?php
3 class HTMLPurifier_HTMLModule_NofollowTest extends HTMLPurifier_HTMLModuleHarness
6 function setUp() {
7 parent::setUp();
8 $this->config->set('HTML.Nofollow', true);
9 $this->config->set('Attr.AllowedRel', array("nofollow", "blah"));
12 function testNofollow() {
13 $this->assertResult(
14 '<a href="http://google.com">x</a><a href="http://google.com" rel="blah">a</a><a href="/local">b</a><a href="mailto:foo@example.com">c</a>',
15 '<a href="http://google.com" rel="nofollow">x</a><a href="http://google.com" rel="blah nofollow">a</a><a href="/local">b</a><a href="mailto:foo@example.com">c</a>'
19 function testNofollowDupe() {
20 $this->assertResult(
21 '<a href="http://google.com" rel="nofollow">x</a><a href="http://google.com" rel="blah nofollow">a</a><a href="/local">b</a><a href="mailto:foo@example.com">c</a>'
27 // vim: et sw=4 sts=4