BoolToCSSTest.php 886 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. class HTMLPurifier_AttrTransform_BoolToCSSTest extends HTMLPurifier_AttrTransformHarness
  3. {
  4. function setUp() {
  5. parent::setUp();
  6. $this->obj = new HTMLPurifier_AttrTransform_BoolToCSS('foo', 'bar:3in;');
  7. }
  8. function testEmptyInput() {
  9. $this->assertResult( array() );
  10. }
  11. function testBasicTransform() {
  12. $this->assertResult(
  13. array('foo' => 'foo'),
  14. array('style' => 'bar:3in;')
  15. );
  16. }
  17. function testIgnoreValueOfBooleanAttribute() {
  18. $this->assertResult(
  19. array('foo' => 'no'),
  20. array('style' => 'bar:3in;')
  21. );
  22. }
  23. function testPrependCSS() {
  24. $this->assertResult(
  25. array('foo' => 'foo', 'style' => 'background-color:#F00;'),
  26. array('style' => 'bar:3in;background-color:#F00;')
  27. );
  28. }
  29. }
  30. // vim: et sw=4 sts=4