Release 2.0.1, merged in 1181 to HEAD.
[htmlpurifier.git] / tests / HTMLPurifier / Injector / PurifierLinkifyTest.php
blobd538c4894b32a524c96a3f219b9da209d0c0e301
1 <?php
3 require_once 'HTMLPurifier/InjectorHarness.php';
4 require_once 'HTMLPurifier/Injector/PurifierLinkify.php';
6 class HTMLPurifier_Injector_PurifierLinkifyTest extends HTMLPurifier_InjectorHarness
9 function setup() {
10 parent::setup();
11 $this->config = array(
12 'AutoFormat.PurifierLinkify' => true,
13 'AutoFormatParam.PurifierLinkifyDocURL' => '#%s'
17 function testLinkify() {
19 $this->assertResult('Foobar');
20 $this->assertResult('20% off!');
21 $this->assertResult('%Core namespace (not recognized)');
22 $this->assertResult(
23 '%Namespace.Directive',
24 '<a href="#Namespace.Directive">%Namespace.Directive</a>'
26 $this->assertResult(
27 'This %Namespace.Directive thing',
28 'This <a href="#Namespace.Directive">%Namespace.Directive</a> thing'
30 $this->assertResult(
31 '<div>This %Namespace.Directive thing</div>',
32 '<div>This <a href="#Namespace.Directive">%Namespace.Directive</a> thing</div>'
34 $this->assertResult(
35 '<a>%Namespace.Directive</a>'