2008-03-04 04:13:07 +00:00
|
|
|
<?php
|
|
|
|
|
2008-03-04 04:20:55 +00:00
|
|
|
class HTMLPurifier_ConfigSchema_Validator_UniqueTest extends HTMLPurifier_ConfigSchema_ValidatorHarness
|
2008-03-04 04:13:07 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
public function setup() {
|
|
|
|
parent::setup();
|
2008-03-04 04:20:55 +00:00
|
|
|
$this->validator = new HTMLPurifier_ConfigSchema_Validator_Unique();
|
2008-03-04 04:13:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|