0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-23 08:51:53 +00:00
htmlpurifier/tests/HTMLPurifier/AttrDef/HTML/ClassTest.php

22 lines
666 B
PHP
Raw Normal View History

<?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');
}
}