You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

OptionalTest.php 740B

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