mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-30 19:00:10 +02:00
[1.7.0] Change ->Revision member variable to a legit configuration directive. Start writing tutorial for customization.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1171 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -8,9 +8,16 @@ class HTMLPurifier_DefinitionCacheTest extends UnitTestCase
|
||||
function test_isOld() {
|
||||
$cache = new HTMLPurifier_DefinitionCache('Test'); // non-functional
|
||||
|
||||
$old_copy = HTMLPurifier_ConfigSchema::instance();
|
||||
$o = new HTMLPurifier_ConfigSchema();
|
||||
HTMLPurifier_ConfigSchema::instance($o);
|
||||
|
||||
HTMLPurifier_ConfigSchema::defineNamespace('Test', 'Test namespace');
|
||||
HTMLPurifier_ConfigSchema::define('Test', 'DefinitionRev', 1, 'int', 'Definition revision.');
|
||||
|
||||
$config = HTMLPurifier_Config::createDefault();
|
||||
$config->version = '1.0.0';
|
||||
$config->revision = 10;
|
||||
$config->set('Test', 'DefinitionRev', 10);
|
||||
|
||||
$this->assertIdentical($cache->isOld('1.0.0-10-hashstuffhere', $config), false);
|
||||
$this->assertIdentical($cache->isOld('1.5.0-1-hashstuffhere', $config), false);
|
||||
@@ -18,6 +25,9 @@ class HTMLPurifier_DefinitionCacheTest extends UnitTestCase
|
||||
$this->assertIdentical($cache->isOld('0.9.0-1-hashstuffhere', $config), true);
|
||||
$this->assertIdentical($cache->isOld('1.0.0-1-hashstuffhere', $config), true);
|
||||
$this->assertIdentical($cache->isOld('1.0.0beta-11-hashstuffhere', $config), true);
|
||||
|
||||
HTMLPurifier_ConfigSchema::instance($old_copy);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user