mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-06 22:26:31 +02:00
[3.1.0] De-crudify the ConfigSchema space; we're starting over again
- Optimize ConfigSchema by removing non-essential runtime data. We can probably optimize even more by collapsing object structures to arrays. - Removed validation data from ConfigSchema; this will be reimplemented on Interchange - Implement a sane Interchange composite hierarchy that doesn't use arrays - Implement StringHash -> Interchange -> ConfigSchema, and rewrite maintenance file to account for this git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1615 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -10,25 +10,17 @@ class HTMLPurifier_ConfigSchema_InterchangeTest extends UnitTestCase
|
||||
}
|
||||
|
||||
public function testAddNamespace() {
|
||||
$this->interchange->addNamespace($v = array(
|
||||
'ID' => 'Namespace',
|
||||
'DESCRIPTION' => 'Bar',
|
||||
));
|
||||
$v = new HTMLPurifier_ConfigSchema_Interchange_Namespace();
|
||||
$v->namespace = 'Namespace';
|
||||
$this->interchange->addNamespace($v);
|
||||
$this->assertIdentical($v, $this->interchange->namespaces['Namespace']);
|
||||
}
|
||||
|
||||
public function testAddDirective() {
|
||||
$this->interchange->addDirective($v = array(
|
||||
'ID' => 'Namespace.Directive',
|
||||
'DESCRIPTION' => 'Bar',
|
||||
));
|
||||
$v = new HTMLPurifier_ConfigSchema_Interchange_Directive();
|
||||
$v->id = new HTMLPurifier_ConfigSchema_Interchange_Id('Namespace', 'Directive');
|
||||
$this->interchange->addDirective($v);
|
||||
$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());
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user