Whoops, forgot to edit WHATSNEW
[htmlpurifier.git] / tests / HTMLPurifier / HTMLModule / TargetNoreferrerTest.php
blobc7abc54224de266b812b894de78d322d446a43c8
1 <?php
3 class HTMLPurifier_HTMLModule_TargetNoreferrerTest extends HTMLPurifier_HTMLModuleHarness
6 public function setUp()
8 parent::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()
16 $this->assertResult(
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');
25 $this->assertResult(
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);
34 $this->assertResult(
35 '<a href="http://google.com">x</a>',
36 '<a href="http://google.com" target="_blank" rel="noreferrer">x</a>'
40 public function testNoTarget()
42 $this->assertResult(
43 '<a href="http://google.com">x</a>',
44 '<a href="http://google.com">x</a>'
51 // vim: et sw=4 sts=4