BorderTest.php 894 B

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