BorderTest.php 949 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. class HTMLPurifier_AttrTransform_BorderTest extends HTMLPurifier_AttrTransformHarness
  3. {
  4. public function setUp()
  5. {
  6. parent::setUp();
  7. $this->obj = new HTMLPurifier_AttrTransform_Border();
  8. }
  9. public function testEmptyInput()
  10. {
  11. $this->assertResult( array() );
  12. }
  13. public function testBasicTransform()
  14. {
  15. $this->assertResult(
  16. array('border' => '1'),
  17. array('style' => 'border:1px solid;')
  18. );
  19. }
  20. public function testLenientTreatmentOfInvalidInput()
  21. {
  22. $this->assertResult(
  23. array('border' => '10%'),
  24. array('style' => 'border:10%px solid;')
  25. );
  26. }
  27. public function testPrependNewCSS()
  28. {
  29. $this->assertResult(
  30. array('border' => '23', 'style' => 'font-weight:bold;'),
  31. array('style' => 'border:23px solid;font-weight:bold;')
  32. );
  33. }
  34. }
  35. // vim: et sw=4 sts=4