2006-08-27 00:11:13 +00:00
|
|
|
<?php
|
|
|
|
|
2007-02-14 20:38:51 +00:00
|
|
|
class HTMLPurifier_AttrDef_CSS_FontTest extends HTMLPurifier_AttrDefHarness
|
2006-08-27 00:11:13 +00:00
|
|
|
{
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-27 00:11:13 +00:00
|
|
|
function test() {
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-02-14 20:38:51 +00:00
|
|
|
$config = HTMLPurifier_Config::createDefault();
|
|
|
|
$this->def = new HTMLPurifier_AttrDef_CSS_Font($config);
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-27 00:11:13 +00:00
|
|
|
// hodgepodge of usage cases from W3C spec, but " -> '
|
|
|
|
$this->assertDef('12px/14px sans-serif');
|
|
|
|
$this->assertDef('80% sans-serif');
|
2010-05-21 15:53:52 +00:00
|
|
|
$this->assertDef('x-large/110% "New Century Schoolbook", serif');
|
2006-08-27 00:11:13 +00:00
|
|
|
$this->assertDef('bold italic large Palatino, serif');
|
|
|
|
$this->assertDef('normal small-caps 120%/120% fantasy');
|
2010-05-21 15:53:52 +00:00
|
|
|
$this->assertDef('300 italic 1.3em/1.7em "FB Armada", sans-serif');
|
2006-08-27 00:11:13 +00:00
|
|
|
$this->assertDef('600 9px Charcoal');
|
|
|
|
$this->assertDef('600 9px/ 12px Charcoal', '600 9px/12px Charcoal');
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-27 00:11:13 +00:00
|
|
|
// spacing
|
|
|
|
$this->assertDef('12px / 14px sans-serif', '12px/14px sans-serif');
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-27 00:11:13 +00:00
|
|
|
// system fonts
|
|
|
|
$this->assertDef('menu');
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-27 00:11:13 +00:00
|
|
|
$this->assertDef('800', false);
|
|
|
|
$this->assertDef('600 9px//12px Charcoal', false);
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-27 00:11:13 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-27 00:11:13 +00:00
|
|
|
}
|
|
|
|
|
2008-12-06 09:24:59 +00:00
|
|
|
// vim: et sw=4 sts=4
|