FontTest.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. class HTMLPurifier_AttrDef_CSS_FontTest extends HTMLPurifier_AttrDefHarness
  3. {
  4. function test() {
  5. $config = HTMLPurifier_Config::createDefault();
  6. $this->def = new HTMLPurifier_AttrDef_CSS_Font($config);
  7. // hodgepodge of usage cases from W3C spec, but " -> '
  8. $this->assertDef('12px/14px sans-serif');
  9. $this->assertDef('80% sans-serif');
  10. $this->assertDef("x-large/110% 'New Century Schoolbook', serif");
  11. $this->assertDef('bold italic large Palatino, serif');
  12. $this->assertDef('normal small-caps 120%/120% fantasy');
  13. $this->assertDef("300 italic 1.3em/1.7em 'FB Armada', sans-serif");
  14. $this->assertDef('600 9px Charcoal');
  15. $this->assertDef('600 9px/ 12px Charcoal', '600 9px/12px Charcoal');
  16. // spacing
  17. $this->assertDef('12px / 14px sans-serif', '12px/14px sans-serif');
  18. // system fonts
  19. $this->assertDef('menu');
  20. $this->assertDef('800', false);
  21. $this->assertDef('600 9px//12px Charcoal', false);
  22. }
  23. }
  24. // vim: et sw=4 sts=4