From 7a40f4354b32809af3d0cfd6e3af0eda02ab0e0a Mon Sep 17 00:00:00 2001 From: friendica Date: Sat, 12 May 2012 17:57:41 -0700 Subject: some important stuff we'll need --- .../Strategy/ValidateAttributes_TidyTest.php | 351 +++++++++++++++++++++ 1 file changed, 351 insertions(+) create mode 100644 lib/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributes_TidyTest.php (limited to 'lib/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributes_TidyTest.php') diff --git a/lib/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributes_TidyTest.php b/lib/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributes_TidyTest.php new file mode 100644 index 000000000..d4eeeebfc --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/Strategy/ValidateAttributes_TidyTest.php @@ -0,0 +1,351 @@ +obj = new HTMLPurifier_Strategy_ValidateAttributes(); + $this->config->set('HTML.TidyLevel', 'heavy'); + } + + function testConvertCenterAlign() { + $this->assertResult( + '

Centered Headline

', + '

Centered Headline

' + ); + } + + function testConvertRightAlign() { + $this->assertResult( + '

Right-aligned Headline

', + '

Right-aligned Headline

' + ); + } + + function testConvertLeftAlign() { + $this->assertResult( + '

Left-aligned Headline

', + '

Left-aligned Headline

' + ); + } + + function testConvertJustifyAlign() { + $this->assertResult( + '

Justified Paragraph

', + '

Justified Paragraph

' + ); + } + + function testRemoveInvalidAlign() { + $this->assertResult( + '

Invalid Headline

', + '

Invalid Headline

' + ); + } + + function testConvertTableLengths() { + $this->assertResult( + '
', + '
' + ); + } + + function testTdConvertNowrap() { + $this->assertResult( + '', + '' + ); + } + + function testCaptionConvertAlignLeft() { + $this->assertResult( + '', + '' + ); + } + + function testCaptionConvertAlignRight() { + $this->assertResult( + '', + '' + ); + } + + function testCaptionConvertAlignTop() { + $this->assertResult( + '', + '' + ); + } + + function testCaptionConvertAlignBottom() { + $this->assertResult( + '', + '' + ); + } + + function testCaptionRemoveInvalidAlign() { + $this->assertResult( + '', + '' + ); + } + + function testTableConvertAlignLeft() { + $this->assertResult( + '', + '
' + ); + } + + function testTableConvertAlignCenter() { + $this->assertResult( + '
', + '
' + ); + } + + function testTableConvertAlignRight() { + $this->assertResult( + '
', + '
' + ); + } + + function testTableRemoveInvalidAlign() { + $this->assertResult( + '
', + '
' + ); + } + + function testImgConvertAlignLeft() { + $this->assertResult( + 'foobar', + 'foobar' + ); + } + + function testImgConvertAlignRight() { + $this->assertResult( + 'foobar', + 'foobar' + ); + } + + function testImgConvertAlignBottom() { + $this->assertResult( + 'foobar', + 'foobar' + ); + } + + function testImgConvertAlignMiddle() { + $this->assertResult( + 'foobar', + 'foobar' + ); + } + + function testImgConvertAlignTop() { + $this->assertResult( + 'foobar', + 'foobar' + ); + } + + function testImgRemoveInvalidAlign() { + $this->assertResult( + 'foobar', + 'foobar' + ); + } + + function testBorderConvertHVSpace() { + $this->assertResult( + 'foo', + 'foo' + ); + } + + function testHrConvertSize() { + $this->assertResult( + '
', + '
' + ); + } + + function testHrConvertNoshade() { + $this->assertResult( + '
', + '
' + ); + } + + function testHrConvertAlignLeft() { + $this->assertResult( + '
', + '
' + ); + } + + function testHrConvertAlignCenter() { + $this->assertResult( + '
', + '
' + ); + } + + function testHrConvertAlignRight() { + $this->assertResult( + '
', + '
' + ); + } + + function testHrRemoveInvalidAlign() { + $this->assertResult( + '
', + '
' + ); + } + + function testBrConvertClearLeft() { + $this->assertResult( + '
', + '
' + ); + } + + function testBrConvertClearRight() { + $this->assertResult( + '
', + '
' + ); + } + + function testBrConvertClearAll() { + $this->assertResult( + '
', + '
' + ); + } + + function testBrConvertClearNone() { + $this->assertResult( + '
', + '
' + ); + } + + function testBrRemoveInvalidClear() { + $this->assertResult( + '
', + '
' + ); + } + + function testUlConvertTypeDisc() { + $this->assertResult( + '