2011-12-25 09:27:25 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class HTMLPurifier_HTMLModule_TargetBlankTest extends HTMLPurifier_HTMLModuleHarness
|
|
|
|
{
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function setUp()
|
|
|
|
{
|
2011-12-25 09:27:25 +00:00
|
|
|
parent::setUp();
|
|
|
|
$this->config->set('HTML.TargetBlank', true);
|
|
|
|
}
|
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testTargetBlank()
|
|
|
|
{
|
2011-12-25 09:27:25 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<a href="http://google.com">a</a><a href="/local">b</a><a href="mailto:foo@example.com">c</a>',
|
2016-07-01 01:42:40 +00:00
|
|
|
'<a href="http://google.com" target="_blank" rel="noreferrer">a</a><a href="/local">b</a><a href="mailto:foo@example.com">c</a>'
|
2011-12-25 09:27:25 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// vim: et sw=4 sts=4
|