2009-03-20 19:34:38 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class HTMLPurifier_HTMLModule_NameTest extends HTMLPurifier_HTMLModuleHarness
|
|
|
|
{
|
|
|
|
|
2013-07-16 13:56:14 +02:00
|
|
|
public function setUp()
|
|
|
|
{
|
2009-03-20 19:34:38 -04:00
|
|
|
parent::setUp();
|
|
|
|
}
|
|
|
|
|
2013-07-16 13:56:14 +02:00
|
|
|
public function testBasicUse()
|
|
|
|
{
|
2009-03-20 19:34:38 -04:00
|
|
|
$this->config->set('Attr.EnableID', true);
|
|
|
|
$this->assertResult(
|
|
|
|
'<a name="foo">bar</a>'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2013-07-16 13:56:14 +02:00
|
|
|
public function testCDATA()
|
|
|
|
{
|
2009-03-20 19:34:38 -04:00
|
|
|
$this->config->set('HTML.Attr.Name.UseCDATA', true);
|
|
|
|
$this->assertResult(
|
|
|
|
'<a name="2">Baz</a><a name="2">Bar</a>'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2013-07-16 13:56:14 +02:00
|
|
|
public function testCDATAWithHeavyTidy()
|
|
|
|
{
|
2009-03-20 19:34:38 -04:00
|
|
|
$this->config->set('HTML.Attr.Name.UseCDATA', true);
|
|
|
|
$this->config->set('HTML.TidyLevel', 'heavy');
|
|
|
|
$this->assertResult('<a name="2">Baz</a>');
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2009-04-09 12:47:10 -04:00
|
|
|
|
|
|
|
// vim: et sw=4 sts=4
|