mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-23 08:51:53 +00:00
3baf1774b2
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1524 48356398-32a2-884e-a903-53898d9a118a
36 lines
1018 B
PHP
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"
|
|
)
|
|
)
|
|
);
|
|
}
|
|
}
|