mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-06 06:07:26 +02:00
[3.1.0] Move ConfigSchema to HTMLPurifier core
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1576 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
class ConfigSchema_StringHashAdapterTest extends UnitTestCase
|
||||
class HTMLPurifier_ConfigSchema_StringHashAdapterTest extends UnitTestCase
|
||||
{
|
||||
function __construct() {
|
||||
generate_mock_once('HTMLPurifier_ConfigSchema');
|
||||
@@ -15,7 +15,7 @@ class ConfigSchema_StringHashAdapterTest extends UnitTestCase
|
||||
if (!isset($called[$func])) $called[$func] = 0;
|
||||
$schema->expectAt($called[$func]++, $func, $params);
|
||||
}
|
||||
$adapter = new ConfigSchema_StringHashAdapter();
|
||||
$adapter = new HTMLPurifier_ConfigSchema_StringHashAdapter();
|
||||
$adapter->adapt($input, $schema);
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* @note Sample input files are located in the StringHashParser/ directory.
|
||||
*/
|
||||
class ConfigSchema_StringHashParserTest extends UnitTestCase
|
||||
class HTMLPurifier_ConfigSchema_StringHashParserTest extends UnitTestCase
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -12,7 +12,7 @@ class ConfigSchema_StringHashParserTest extends UnitTestCase
|
||||
protected $parser;
|
||||
|
||||
function setup() {
|
||||
$this->parser = new ConfigSchema_StringHashParser();
|
||||
$this->parser = new HTMLPurifier_ConfigSchema_StringHashParser();
|
||||
}
|
||||
|
||||
/**
|
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
class ConfigSchema_StringHashReverseAdapterTest extends UnitTestCase
|
||||
class HTMLPurifier_ConfigSchema_StringHashReverseAdapterTest extends UnitTestCase
|
||||
{
|
||||
|
||||
function makeSchema() {
|
||||
@@ -17,7 +17,7 @@ class ConfigSchema_StringHashReverseAdapterTest extends UnitTestCase
|
||||
}
|
||||
|
||||
function testNamespace() {
|
||||
$adapter = new ConfigSchema_StringHashReverseAdapter($this->makeSchema());
|
||||
$adapter = new HTMLPurifier_ConfigSchema_StringHashReverseAdapter($this->makeSchema());
|
||||
$result = $adapter->get('Ns');
|
||||
$expect = array(
|
||||
'ID' => 'Ns',
|
||||
@@ -27,14 +27,14 @@ class ConfigSchema_StringHashReverseAdapterTest extends UnitTestCase
|
||||
}
|
||||
|
||||
function testBadNamespace() {
|
||||
$adapter = new ConfigSchema_StringHashReverseAdapter($this->makeSchema());
|
||||
$adapter = new HTMLPurifier_ConfigSchema_StringHashReverseAdapter($this->makeSchema());
|
||||
$this->expectError("Namespace 'BadNs' doesn't exist in schema");
|
||||
$adapter->get('BadNs');
|
||||
}
|
||||
|
||||
function testDirective() {
|
||||
|
||||
$adapter = new ConfigSchema_StringHashReverseAdapter($this->makeSchema());
|
||||
$adapter = new HTMLPurifier_ConfigSchema_StringHashReverseAdapter($this->makeSchema());
|
||||
|
||||
$result = $adapter->get('Ns', 'Dir');
|
||||
$expect = array(
|
||||
@@ -53,13 +53,13 @@ class ConfigSchema_StringHashReverseAdapterTest extends UnitTestCase
|
||||
}
|
||||
|
||||
function testBadDirective() {
|
||||
$adapter = new ConfigSchema_StringHashReverseAdapter($this->makeSchema());
|
||||
$adapter = new HTMLPurifier_ConfigSchema_StringHashReverseAdapter($this->makeSchema());
|
||||
$this->expectError("Directive 'BadNs.BadDir' doesn't exist in schema");
|
||||
$adapter->get('BadNs', 'BadDir');
|
||||
}
|
||||
|
||||
function assertMethod($func, $input, $expect) {
|
||||
$adapter = new ConfigSchema_StringHashReverseAdapter($this->makeSchema());
|
||||
$adapter = new HTMLPurifier_ConfigSchema_StringHashReverseAdapter($this->makeSchema());
|
||||
$result = $adapter->$func($input);
|
||||
$this->assertIdentical($result, $expect);
|
||||
}
|
||||
@@ -85,7 +85,7 @@ class ConfigSchema_StringHashReverseAdapterTest extends UnitTestCase
|
||||
}
|
||||
|
||||
function assertExtraction($desc, $expect_desc, $expect_version) {
|
||||
$adapter = new ConfigSchema_StringHashReverseAdapter($this->makeSchema());
|
||||
$adapter = new HTMLPurifier_ConfigSchema_StringHashReverseAdapter($this->makeSchema());
|
||||
list($result_desc, $result_version) = $adapter->extractVersion($desc);
|
||||
$this->assertIdentical($result_desc, $expect_desc);
|
||||
$this->assertIdentical($result_version, $expect_version);
|
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
class ConfigSchema_StringHashTest extends UnitTestCase
|
||||
class HTMLPurifier_ConfigSchema_StringHashTest extends UnitTestCase
|
||||
{
|
||||
|
||||
public function testUsed() {
|
||||
$hash = new ConfigSchema_StringHash(array(
|
||||
$hash = new HTMLPurifier_ConfigSchema_StringHash(array(
|
||||
'key' => 'value',
|
||||
'key2' => 'value2'
|
||||
));
|
@@ -64,6 +64,10 @@ $test_files[] = 'HTMLPurifier/ChildDef/RequiredTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ChildDef/StrictBlockquoteTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ChildDef/TableTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ConfigSchemaTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ConfigSchema/StringHashAdapterTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ConfigSchema/StringHashReverseAdapterTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ConfigSchema/StringHashParserTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ConfigSchema/StringHashTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ConfigTest.php';
|
||||
$test_files[] = 'HTMLPurifier/ContextTest.php';
|
||||
$test_files[] = 'HTMLPurifier/DefinitionCacheFactoryTest.php';
|
||||
@@ -136,13 +140,6 @@ if ($csstidy_location) {
|
||||
|
||||
$test_files[] = 'FSTools/FileTest.php';
|
||||
|
||||
// ConfigSchema auxiliary library
|
||||
|
||||
$test_files[] = 'ConfigSchema/StringHashAdapterTest.php';
|
||||
$test_files[] = 'ConfigSchema/StringHashReverseAdapterTest.php';
|
||||
$test_files[] = 'ConfigSchema/StringHashParserTest.php';
|
||||
$test_files[] = 'ConfigSchema/StringHashTest.php';
|
||||
|
||||
} // end if ($AC['only-phpt'])
|
||||
|
||||
// PHPT tests
|
||||
|
Reference in New Issue
Block a user