Support for inline-block.
[htmlpurifier.git] / tests / HTMLPurifier / Injector / LinkifyTest.php
blob1a1542d53b96df7cddd6eb057f9fa94e688fa8ac
1 <?php
3 class HTMLPurifier_Injector_LinkifyTest extends HTMLPurifier_InjectorHarness
6 function setup() {
7 parent::setup();
8 $this->config->set('AutoFormat.Linkify', true);
11 function testLinkifyURLInRootNode() {
12 $this->assertResult(
13 'http://example.com',
14 '<a href="http://example.com">http://example.com</a>'
18 function testLinkifyURLInInlineNode() {
19 $this->assertResult(
20 '<b>http://example.com</b>',
21 '<b><a href="http://example.com">http://example.com</a></b>'
25 function testBasicUsageCase() {
26 $this->assertResult(
27 'This URL http://example.com is what you need',
28 'This URL <a href="http://example.com">http://example.com</a> is what you need'
32 function testIgnoreURLInATag() {
33 $this->assertResult(
34 '<a>http://example.com/</a>'
38 function testNeeded() {
39 $this->config->set('HTML.Allowed', 'b');
40 $this->expectError('Cannot enable Linkify injector because a is not allowed');
41 $this->assertResult('http://example.com/');
44 function testExcludes() {
45 $this->assertResult('<a><span>http://example.com</span></a>');
50 // vim: et sw=4 sts=4