0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-11-14 09:18:41 +00:00
htmlpurifier/tests/HTMLPurifier/AttrTransform/BoolToCSSTest.php
Edward Z. Yang bd58a7ba77 [1.6.1] Implement BoolToCSS attribute transformations for td,th.nowrap and hr.noshade
- Implement CSS property white-space:nowrap;
- Update TODO with more ambitious goal: all transforms by 1.6.1

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1012 48356398-32a2-884e-a903-53898d9a118a
2007-05-03 04:07:47 +00:00

39 lines
979 B
PHP

<?php
require_once 'HTMLPurifier/AttrTransform/BoolToCSS.php';
require_once 'HTMLPurifier/AttrTransformHarness.php';
class HTMLPurifier_AttrTransform_BoolToCSSTest extends HTMLPurifier_AttrTransformHarness
{
function setUp() {
parent::setUp();
$this->obj = new HTMLPurifier_AttrTransform_BoolToCSS('foo', 'bar:3in;');
}
function test() {
$this->assertResult( array() );
$this->assertResult(
array('foo' => 'foo'),
array('style' => 'bar:3in;')
);
// boolean attribute just has to be set: we don't care about
// anything else
$this->assertResult(
array('foo' => 'no'),
array('style' => 'bar:3in;')
);
$this->assertResult(
array('foo' => 'foo', 'style' => 'background-color:#F00;'),
array('style' => 'bar:3in;background-color:#F00;')
);
}
}
?>