mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-11-15 01:28:42 +00:00
d8cb360f3b
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1589 48356398-32a2-884e-a903-53898d9a118a
35 lines
1.0 KiB
PHP
35 lines
1.0 KiB
PHP
<?php
|
|
|
|
class HTMLPurifier_ConfigSchema_InterchangeTest extends UnitTestCase
|
|
{
|
|
|
|
protected $interchange;
|
|
|
|
public function setup() {
|
|
$this->interchange = new HTMLPurifier_ConfigSchema_Interchange();
|
|
}
|
|
|
|
public function testAddNamespace() {
|
|
$this->interchange->addNamespace($v = array(
|
|
'ID' => 'Namespace',
|
|
'DESCRIPTION' => 'Bar',
|
|
));
|
|
$this->assertIdentical($v, $this->interchange->namespaces['Namespace']);
|
|
}
|
|
|
|
public function testAddDirective() {
|
|
$this->interchange->addDirective($v = array(
|
|
'ID' => 'Namespace.Directive',
|
|
'DESCRIPTION' => 'Bar',
|
|
));
|
|
$this->assertIdentical($v, $this->interchange->directives['Namespace.Directive']);
|
|
}
|
|
|
|
public function testValidator() {
|
|
$adapter = $this->interchange->getValidatorAdapter();
|
|
$this->expectException(new HTMLPurifier_ConfigSchema_Exception('ID must exist'));
|
|
$adapter->addDirective(array());
|
|
}
|
|
|
|
}
|