Convert all to new configuration get/set format.
[htmlpurifier/bfroehle.git] / tests / HTMLPurifier / Strategy / MakeWellFormed / EndInsertInjectorTest.php
blob72e833b712119998edce79ee041b213704a27fac
1 <?php
3 class HTMLPurifier_Strategy_MakeWellFormed_EndInsertInjectorTest extends HTMLPurifier_StrategyHarness
5 function setUp() {
6 parent::setUp();
7 $this->obj = new HTMLPurifier_Strategy_MakeWellFormed();
8 $this->config->set('AutoFormat.Custom', array(
9 new HTMLPurifier_Strategy_MakeWellFormed_EndInsertInjector()
10 ));
12 function testEmpty() {
13 $this->assertResult('');
15 function testNormal() {
16 $this->assertResult('<i>Foo</i>', '<i>Foo<b>Comment</b></i>');
18 function testEndOfDocumentProcessing() {
19 $this->assertResult('<i>Foo', '<i>Foo<b>Comment</b></i>');
21 function testDoubleEndOfDocumentProcessing() {
22 $this->assertResult('<i><i>Foo', '<i><i>Foo<b>Comment</b></i><b>Comment</b></i>');
24 function testEndOfNodeProcessing() {
25 $this->assertResult('<div><i>Foo</div>asdf', '<div><i>Foo<b>Comment</b></i></div><i>asdf<b>Comment</b></i>');
27 function testEmptyToStartEndProcessing() {
28 $this->assertResult('<i />', '<i><b>Comment</b></i>');
30 function testSpuriousEndTag() {
31 $this->assertResult('</i>', '');
33 function testLessButStillSpuriousEndTag() {
34 $this->assertResult('<div></i></div>', '<div></div>');
38 // vim: et sw=4 sts=4