mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-10-15 06:04:23 +02:00
Implement schema extraction script; almost done except for version extraction. Also, some minor refinements.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1534 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -57,4 +57,30 @@ class ConfigSchema_StringHashReverseAdapterTest extends UnitTestCase
|
||||
$adapter->get('BadNs', 'BadDir');
|
||||
}
|
||||
|
||||
function assertMethod($func, $input, $expect) {
|
||||
$adapter = new ConfigSchema_StringHashReverseAdapter($this->makeSchema());
|
||||
$result = $adapter->$func($input);
|
||||
$this->assertIdentical($result, $expect);
|
||||
}
|
||||
|
||||
function testExportEmptyHash() {
|
||||
$this->assertMethod('exportHash', array(), '');
|
||||
}
|
||||
|
||||
function testExportHash() {
|
||||
$this->assertMethod('exportHash', array('foo' => 'bar'), "'foo' => 'bar',\n");
|
||||
}
|
||||
|
||||
function testExportEmptyLookup() {
|
||||
$this->assertMethod('exportLookup', array(), '');
|
||||
}
|
||||
|
||||
function testExportSingleLookup() {
|
||||
$this->assertMethod('exportLookup', array('key' => true), "'key'");
|
||||
}
|
||||
|
||||
function testExportLookup() {
|
||||
$this->assertMethod('exportLookup', array('key' => true, 'key2' => true, 3 => true), "'key', 'key2', 3");
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user