0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-24 01:01:53 +00:00
htmlpurifier/tests/HTMLPurifier/ConfigSchema/Validator/UniqueTest.php

26 lines
881 B
PHP
Raw Normal View History

<?php
class HTMLPurifier_ConfigSchema_Validator_UniqueTest extends HTMLPurifier_ConfigSchema_ValidatorHarness
{
public function setup() {
parent::setup();
$this->validator = new HTMLPurifier_ConfigSchema_Validator_Unique();
}
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);
}
}