mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-01-11 00:11:53 +00:00
baf053b016
Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
22 lines
666 B
PHP
22 lines
666 B
PHP
<?php
|
|
|
|
class HTMLPurifier_AttrDef_HTML_ClassTest extends HTMLPurifier_AttrDef_HTML_NmtokensTest
|
|
{
|
|
function setUp() {
|
|
parent::setUp();
|
|
$this->def = new HTMLPurifier_AttrDef_HTML_Class();
|
|
}
|
|
function testAllowedClasses() {
|
|
$this->config->set('Attr.AllowedClasses', array('foo'));
|
|
$this->assertDef('foo');
|
|
$this->assertDef('bar', false);
|
|
$this->assertDef('foo bar', 'foo');
|
|
}
|
|
function testForbiddenClasses() {
|
|
$this->config->set('Attr.ForbiddenClasses', array('bar'));
|
|
$this->assertDef('foo');
|
|
$this->assertDef('bar', false);
|
|
$this->assertDef('foo bar', 'foo');
|
|
}
|
|
}
|