Refactor HTML.Noopener to HTML.TargetNoopener so that it behaves like HTML.TargetNore...
[htmlpurifier.git] / tests / HTMLPurifier / HTMLModule / TargetBlankTest.php
blobf837309f8c516090a1d07d1067fc61313d3951e1
1 <?php
3 class HTMLPurifier_HTMLModule_TargetBlankTest extends HTMLPurifier_HTMLModuleHarness
6 public function setUp()
8 parent::setUp();
9 $this->config->set('HTML.TargetBlank', true);
12 public function testTargetBlank()
14 $this->assertResult(
15 '<a href="http://google.com">a</a><a href="/local">b</a><a href="mailto:foo@example.com">c</a>',
16 '<a href="http://google.com" target="_blank" rel="noreferrer noopener">a</a><a href="/local">b</a><a href="mailto:foo@example.com">c</a>'
20 public function testTargetBlankNoDupe() {
21 $this->assertResult(
22 '<a href="http://google.com" target="_blank">a</a>',
23 '<a href="http://google.com" target="_blank" rel="noreferrer noopener">a</a>'
29 // vim: et sw=4 sts=4