0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-01-11 00:11:53 +00:00
htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/DuplicateTest.php
2008-03-04 04:13:07 +00:00

26 lines
887 B
PHP

<?php
class HTMLPurifier_ConfigSchema_Validator_DuplicateTest extends HTMLPurifier_ConfigSchema_ValidatorHarness
{
public function setup() {
parent::setup();
$this->validator = new HTMLPurifier_ConfigSchema_Validator_Duplicate();
}
public function testValidateNamespace() {
$this->interchange->addNamespace(array('ID' => 'Namespace'));
$this->expectSchemaException('Cannot redefine namespace');
$arr = array('ID' => 'Namespace');
$this->validator->validate($arr, $this->interchange);
}
public function testValidateDirective() {
$this->interchange->addDirective(array('ID' => 'Namespace.Directive'));
$this->expectSchemaException('Cannot redefine directive');
$arr = array('ID' => 'Namespace.Directive');
$this->validator->validate($arr, $this->interchange);
}
}