0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-23 08:51:53 +00:00
htmlpurifier/tests/ConfigSchema/StringHashAdapterTest.php
2008-01-27 19:59:12 +00:00

36 lines
1018 B
PHP

<?php
class ConfigSchema_StringHashAdapterTest extends UnitTestCase
{
function __construct() {
generate_mock_once('HTMLPurifier_ConfigSchema');
parent::UnitTestCase();
}
function assertAdapt($input, $calls) {
$schema = new HTMLPurifier_ConfigSchemaMock();
foreach ($calls as $func => $params) {
$schema->expectOnce($func, $params);
}
$adapter = new ConfigSchema_StringHashAdapter();
$adapter->adapt($input, $schema);
}
function testBasic() {
$this->assertAdapt(
array(
'ID' => 'Namespace.Directive',
'DEFAULT' => "'default' . 'bar'",
'TYPE' => 'string',
'DESCRIPTION' => "Description of default.\n",
),
array(
'add' => array(
'Namespace', 'Directive', 'defaultbar', 'string',
"Description of default.\n"
)
)
);
}
}