1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-06 14:16:32 +02:00

Implement attribute transforms for required attributes. I can now confidently say that output will always be valid.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@256 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-08-14 23:11:28 +00:00
parent e770d994a7
commit 24c64dbbac
12 changed files with 229 additions and 37 deletions

View File

@@ -0,0 +1,36 @@
<?php
require_once 'HTMLPurifier/AttrTransform/BdoDir.php';
class HTMLPurifier_AttrTransform_BdoDirTest extends HTMLPurifier_AttrTransformHarness
{
function test() {
$this->transform = new HTMLPurifier_AttrTransform_BdoDir();
$inputs = array();
$expect = array();
$config = array();
// add dir
$inputs[0] = array();
$expect[0] = array('dir' => 'ltr');
// leave existing dir alone
$inputs[1] = array('dir' => 'rtl');
$expect[1] = array('dir' => 'rtl');
$config_rtl = HTMLPurifier_Config::createDefault();
$config_rtl->set('Attr', 'DefaultTextDir', 'rtl');
$inputs[2] = array();
$expect[2] = array('dir' => 'rtl');
$config[2] = $config_rtl;
$this->assertTransform($inputs, $expect, $config);
}
}
?>