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.

BoolToCSSTest.php 941B

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