Add vim modelines to all files.
[htmlpurifier.git] / tests / HTMLPurifier / Injector / PurifierLinkifyTest.php
blobf3ae67ad106006d8acb818a5d0b444ead9f7848e
1 <?php
3 class HTMLPurifier_Injector_PurifierLinkifyTest extends HTMLPurifier_InjectorHarness
6 function setup() {
7 parent::setup();
8 $this->config->set('AutoFormat', 'PurifierLinkify', true);
9 $this->config->set('AutoFormatParam', 'PurifierLinkifyDocURL', '#%s');
12 function testNoTriggerCharacer() {
13 $this->assertResult('Foobar');
16 function testTriggerCharacterInIrrelevantContext() {
17 $this->assertResult('20% off!');
20 function testPreserveNamespace() {
21 $this->assertResult('%Core namespace (not recognized)');
24 function testLinkifyBasic() {
25 $this->assertResult(
26 '%Namespace.Directive',
27 '<a href="#Namespace.Directive">%Namespace.Directive</a>'
31 function testLinkifyWithAdjacentTextNodes() {
32 $this->assertResult(
33 'This %Namespace.Directive thing',
34 'This <a href="#Namespace.Directive">%Namespace.Directive</a> thing'
38 function testLinkifyInBlock() {
39 $this->assertResult(
40 '<div>This %Namespace.Directive thing</div>',
41 '<div>This <a href="#Namespace.Directive">%Namespace.Directive</a> thing</div>'
45 function testPreserveInATag() {
46 $this->assertResult(
47 '<a>%Namespace.Directive</a>'
51 function testNeeded() {
52 $this->config->set('HTML', 'Allowed', 'b');
53 $this->expectError('Cannot enable PurifierLinkify injector because a is not allowed');
54 $this->assertResult('%Namespace.Directive');
59 // vim: et sw=4 sts=4