BackgroundTest.php 916 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. class HTMLPurifier_AttrDef_CSS_BackgroundTest extends HTMLPurifier_AttrDefHarness
  3. {
  4. public function test()
  5. {
  6. $config = HTMLPurifier_Config::createDefault();
  7. $this->def = new HTMLPurifier_AttrDef_CSS_Background($config);
  8. $valid = '#333 url("chess.png") repeat fixed 50% top';
  9. $this->assertDef($valid);
  10. $this->assertDef('url(\'chess.png\') #333 50% top repeat fixed', $valid);
  11. $this->assertDef(
  12. 'rgb(34%, 56%, 33%) url(chess.png) repeat fixed top',
  13. 'rgb(34%,56%,33%) url("chess.png") repeat fixed top'
  14. );
  15. $this->assertDef(
  16. 'rgba(74, 12, 85, 0.35) repeat fixed bottom',
  17. 'rgba(74,12,85,0.35) repeat fixed bottom'
  18. );
  19. $this->assertDef(
  20. 'hsl(244, 47.4%, 88.1%) right center',
  21. 'hsl(244,47.4%,88.1%) right center'
  22. );
  23. }
  24. }
  25. // vim: et sw=4 sts=4