From 62c6d93b6d1db23444c67520237a363b9f28a596 Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Sun, 24 Jun 2007 02:59:06 +0000 Subject: [PATCH] Add more unit tests; everything seems to be good, but I'm suspicious. git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1217 48356398-32a2-884e-a903-53898d9a118a --- .../Strategy/MakeWellFormedTest.php | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/tests/HTMLPurifier/Strategy/MakeWellFormedTest.php b/tests/HTMLPurifier/Strategy/MakeWellFormedTest.php index 8ab6f907..5a6d4e7a 100644 --- a/tests/HTMLPurifier/Strategy/MakeWellFormedTest.php +++ b/tests/HTMLPurifier/Strategy/MakeWellFormedTest.php @@ -9,6 +9,7 @@ class HTMLPurifier_Strategy_MakeWellFormedTest extends HTMLPurifier_StrategyHarn function setUp() { parent::setUp(); $this->obj = new HTMLPurifier_Strategy_MakeWellFormed(); + $this->config = array(); } function testNormalIntegration() { @@ -176,6 +177,70 @@ Par } + function testLinkify() { + + $this->config = array('Core.AutoLinkify' => true); + + $this->assertResult( + 'http://example.com', + 'http://example.com' + ); + + $this->assertResult( + 'http://example.com', + 'http://example.com' + ); + + $this->assertResult( + 'This URL http://example.com is what you need', + 'This URL http://example.com is what you need' + ); + + } + + function testMultipleInjectors() { + + $this->config = array('Core.AutoParagraph' => true, 'Core.AutoLinkify' => true); + + $this->assertResult( + 'Foobar', + '

Foobar

' + ); + + $this->assertResult( + 'http://example.com', + '

http://example.com

' + ); + + $this->assertResult( + 'http://example.com', + '

http://example.com

' + ); + + $this->assertResult( + 'http://example.com', + '

http://example.com

' + ); + + $this->assertResult( +'http://example.com + +http://dev.example.com', + '

http://example.com

http://dev.example.com

' + ); + + $this->assertResult( + 'http://example.com
http://example.com
', + '

http://example.com

http://example.com
' + ); + + $this->assertResult( + 'This URL http://example.com is what you need', + '

This URL http://example.com is what you need

' + ); + + } + } ?> \ No newline at end of file