3 require_once 'HTMLPurifier/Token.php';
4 require_once 'HTMLPurifier/AttrTransformHarness.php';
5 require_once 'HTMLPurifier/AttrTransform/Lang.php';
7 class HTMLPurifier_AttrTransform_LangTest
8 extends HTMLPurifier_AttrTransformHarness
13 $this->obj
= new HTMLPurifier_AttrTransform_Lang();
18 // leave non-lang'ed elements alone
19 $this->assertResult(array(), true);
21 // copy lang to xml:lang
23 array('lang' => 'en'),
24 array('lang' => 'en', 'xml:lang' => 'en')
27 // preserve attributes
29 array('src' => 'vert.png', 'lang' => 'fr'),
30 array('src' => 'vert.png', 'lang' => 'fr', 'xml:lang' => 'fr')
33 // copy xml:lang to lang
35 array('xml:lang' => 'en'),
36 array('xml:lang' => 'en', 'lang' => 'en')
39 // both set, override lang with xml:lang
41 array('lang' => 'fr', 'xml:lang' => 'de'),
42 array('lang' => 'de', 'xml:lang' => 'de')