3 class HTMLPurifier_HTMLModule_TargetNoreferrerTest
extends HTMLPurifier_HTMLModuleHarness
6 public function setUp()
9 $this->config
->set('HTML.TargetNoreferrer', true);
10 $this->config
->set('HTML.TargetNoopener', false);
11 $this->config
->set('Attr.AllowedFrameTargets', '_blank');
14 public function testNoreferrer()
17 '<a href="http://google.com" target="_blank">x</a>',
18 '<a href="http://google.com" target="_blank" rel="noreferrer">x</a>'
22 public function testNoreferrerNoDupe()
24 $this->config
->set('Attr.AllowedRel', 'noreferrer');
26 '<a href="http://google.com" target="_blank" rel="noreferrer">x</a>',
27 '<a href="http://google.com" target="_blank" rel="noreferrer">x</a>'
31 public function testTargetBlankNoreferrer()
33 $this->config
->set('HTML.TargetBlank', true);
35 '<a href="http://google.com">x</a>',
36 '<a href="http://google.com" target="_blank" rel="noreferrer">x</a>'
40 public function testNoTarget()
43 '<a href="http://google.com">x</a>',
44 '<a href="http://google.com">x</a>'