PSR-2 reformatting PHPDoc corrections
[htmlpurifier.git] / tests / HTMLPurifier / Injector / RemoveEmptyTest.php
blobd25b218f723c9734a74a524b033d016d0d2ed206
1 <?php
3 class HTMLPurifier_Injector_RemoveEmptyTest extends HTMLPurifier_InjectorHarness
6 public function setup()
8 parent::setup();
9 $this->config->set('AutoFormat.RemoveEmpty', true);
12 public function testPreserve()
14 $this->assertResult('<b>asdf</b>');
17 public function testRemove()
19 $this->assertResult('<b></b>', '');
22 public function testRemoveWithSpace()
24 $this->assertResult('<b> </b>', '');
27 public function testRemoveWithAttr()
29 $this->assertResult('<b class="asdf"></b>', '');
32 public function testRemoveIdAndName()
34 $this->assertResult('<a id="asdf" name="asdf"></a>', '');
37 public function testPreserveColgroup()
39 $this->assertResult('<colgroup></colgroup>');
42 public function testPreserveId()
44 $this->config->set('Attr.EnableID', true);
45 $this->assertResult('<a id="asdf"></a>');
48 public function testPreserveName()
50 $this->config->set('Attr.EnableID', true);
51 $this->assertResult('<a name="asdf"></a>');
54 public function testRemoveNested()
56 $this->assertResult('<b><i></i></b>', '');
59 public function testRemoveNested2()
61 $this->assertResult('<b><i><u></u></i></b>', '');
64 public function testRemoveNested3()
66 $this->assertResult('<b> <i> <u> </u> </i> </b>', '');
69 public function testRemoveNbsp()
71 $this->config->set('AutoFormat.RemoveEmpty.RemoveNbsp', true);
72 $this->assertResult('<b>&nbsp;</b>', '');
75 public function testRemoveNbspMix()
77 $this->config->set('AutoFormat.RemoveEmpty.RemoveNbsp', true);
78 $this->assertResult('<b>&nbsp; &nbsp;</b>', '');
81 public function testDontRemoveNbsp()
83 $this->config->set('AutoFormat.RemoveEmpty.RemoveNbsp', true);
84 $this->assertResult('<td>&nbsp;</b>', "<td>\xC2\xA0</td>");
87 public function testRemoveNbspExceptionsSpecial()
89 $this->config->set('AutoFormat.RemoveEmpty.RemoveNbsp', true);
90 $this->config->set('AutoFormat.RemoveEmpty.RemoveNbsp.Exceptions', 'b');
91 $this->assertResult('<b>&nbsp;</b>', "<b>\xC2\xA0</b>");
96 // vim: et sw=4 sts=4