2007-01-20 02:21:43 +00:00
|
|
|
<?php
|
|
|
|
|
2007-02-14 20:38:51 +00:00
|
|
|
class HTMLPurifier_AttrDef_CSS_BackgroundTest extends HTMLPurifier_AttrDefHarness
|
2007-01-20 02:21:43 +00:00
|
|
|
{
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function test()
|
|
|
|
{
|
2007-02-14 20:38:51 +00:00
|
|
|
$config = HTMLPurifier_Config::createDefault();
|
|
|
|
$this->def = new HTMLPurifier_AttrDef_CSS_Background($config);
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2010-05-21 15:53:52 +00:00
|
|
|
$valid = '#333 url("chess.png") repeat fixed 50% top';
|
2007-01-20 02:21:43 +00:00
|
|
|
$this->assertDef($valid);
|
2010-05-21 15:53:52 +00:00
|
|
|
$this->assertDef('url(\'chess.png\') #333 50% top repeat fixed', $valid);
|
2008-03-16 19:14:39 +00:00
|
|
|
$this->assertDef(
|
2017-02-09 23:38:05 +00:00
|
|
|
'rgb(34%, 56%, 33%) url(chess.png) repeat fixed top',
|
|
|
|
'rgb(34%,56%,33%) url("chess.png") repeat fixed top'
|
|
|
|
);
|
|
|
|
$this->assertDef(
|
|
|
|
'rgba(74, 12, 85, 0.35) repeat fixed bottom',
|
|
|
|
'rgba(74,12,85,.35) repeat fixed bottom'
|
|
|
|
);
|
|
|
|
$this->assertDef(
|
|
|
|
'hsl(244, 47.4%, 88.1%) right center',
|
|
|
|
'hsl(244,47.4%,88.1%) right center'
|
2008-03-16 19:14:39 +00:00
|
|
|
);
|
2007-01-20 02:21:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-06 09:24:59 +00:00
|
|
|
// vim: et sw=4 sts=4
|