mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-10-16 14:36:04 +02:00
Refactor validators so that they can be reused between directives and namespaces.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1589 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
17
tests/HTMLPurifier/ConfigSchema/Validator/AlnumTest.php
Normal file
17
tests/HTMLPurifier/ConfigSchema/Validator/AlnumTest.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
class HTMLPurifier_ConfigSchema_Validator_AlnumTest extends HTMLPurifier_ConfigSchema_ValidatorHarness
|
||||
{
|
||||
|
||||
public function setup() {
|
||||
parent::setup();
|
||||
$this->validator = new HTMLPurifier_ConfigSchema_Validator_Alnum('ID');
|
||||
}
|
||||
|
||||
public function testValidate() {
|
||||
$this->expectSchemaException('R&D in ID must be alphanumeric');
|
||||
$arr = array('ID' => 'R&D');
|
||||
$this->validator->validate($arr, $this->interchange);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user