Prepended constants with C_ to avoid reserved words as per https://www.php.net/manual...
[htmlpurifier/darkodev.git] / tests / HTMLPurifier / HTMLModule / NofollowTest.php
blob70974ac6b298120b7a9e61ce818caba5b25c31ff
1 <?php
3 class HTMLPurifier_HTMLModule_NofollowTest extends HTMLPurifier_HTMLModuleHarness
6 public function setUp()
8 parent::setUp();
9 $this->config->set('HTML.Nofollow', true);
10 $this->config->set('Attr.AllowedRel', array("nofollow", "blah"));
13 public function testNofollow()
15 $this->assertResult(
16 '<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>',
17 '<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>'
21 public function testNofollowDupe()
23 $this->assertResult(
24 '<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>'
30 // vim: et sw=4 sts=4