diff --git a/extras/ConfigSchema/StringHashAdapter.php b/extras/ConfigSchema/StringHashAdapter.php new file mode 100644 index 00000000..d1098f30 --- /dev/null +++ b/extras/ConfigSchema/StringHashAdapter.php @@ -0,0 +1,22 @@ +add($ns, $directive, $default, $type, $description); + } + +} diff --git a/tests/ConfigSchema/StringHashAdapterTest.php b/tests/ConfigSchema/StringHashAdapterTest.php new file mode 100644 index 00000000..087d6099 --- /dev/null +++ b/tests/ConfigSchema/StringHashAdapterTest.php @@ -0,0 +1,35 @@ + $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" + ) + ) + ); + } +} diff --git a/tests/test_files.php b/tests/test_files.php index dec38e1b..73527851 100644 --- a/tests/test_files.php +++ b/tests/test_files.php @@ -136,4 +136,5 @@ $test_files[] = 'FSTools/FileTest.php'; // ConfigSchema auxiliary library +$test_files[] = 'ConfigSchema/StringHashAdapterTest.php'; $test_files[] = 'ConfigSchema/StringHashParserTest.php';