OptionalTest.php 674 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. class HTMLPurifier_ChildDef_OptionalTest extends HTMLPurifier_ChildDefHarness
  3. {
  4. function setUp() {
  5. parent::setUp();
  6. $this->obj = new HTMLPurifier_ChildDef_Optional('b | i');
  7. }
  8. function testBasicUsage() {
  9. $this->assertResult('<b>Bold text</b><img />', '<b>Bold text</b>');
  10. }
  11. function testRemoveForbiddenText() {
  12. $this->assertResult('Not allowed text', '');
  13. }
  14. function testEmpty() {
  15. $this->assertResult('');
  16. }
  17. function testWhitespace() {
  18. $this->assertResult(' ');
  19. }
  20. function testMultipleWhitespace() {
  21. $this->assertResult(' ');
  22. }
  23. }
  24. // vim: et sw=4 sts=4