mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-01 11:50:28 +02:00
Major optimization on tokenizeDOM(), reduce execution time from 75% to 20% by passing tokens by reference and using a token factory.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@265 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
19
tests/HTMLPurifier/TokenFactoryTest.php
Normal file
19
tests/HTMLPurifier/TokenFactoryTest.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
require_once 'HTMLPurifier/TokenFactory.php';
|
||||
|
||||
class HTMLPurifier_TokenFactoryTest extends UnitTestCase
|
||||
{
|
||||
public function test() {
|
||||
|
||||
$factory = new HTMLPurifier_TokenFactory();
|
||||
|
||||
$regular = new HTMLPurifier_Token_Start('a', array('href' => 'about:blank'));
|
||||
$generated = $factory->createStart('a', array('href' => 'about:blank'));
|
||||
|
||||
$this->assertEqual($regular, $generated);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user