mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-08 23:26:39 +02:00
[2.0.1] Revamp error collector scheme: we now have custom mocks and an exchange of responsibilities
- Fix oversight in AutoParagraph dealing with armor. - Order errors with no line number last - Language object now needs $config and $context objects to do parameterized objects - Auto-close notice added - Token constructors accept line numbers git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1245 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
require_once 'HTMLPurifier/ErrorCollector.php';
|
||||
require_once 'HTMLPurifier/ErrorCollectorEMock.php';
|
||||
require_once 'HTMLPurifier/Lexer/DirectLex.php';
|
||||
|
||||
class HTMLPurifier_ErrorsHarness extends UnitTestCase
|
||||
@@ -13,7 +13,8 @@ class HTMLPurifier_ErrorsHarness extends UnitTestCase
|
||||
$this->config = HTMLPurifier_Config::create(array('Core.CollectErrors' => true));
|
||||
$this->context = new HTMLPurifier_Context();
|
||||
generate_mock_once('HTMLPurifier_ErrorCollector');
|
||||
$this->collector = new HTMLPurifier_ErrorCollectorMock();
|
||||
$this->collector = new HTMLPurifier_ErrorCollectorEMock();
|
||||
$this->collector->prepare($this->context);
|
||||
$this->context->register('ErrorCollector', $this->collector);
|
||||
}
|
||||
|
||||
@@ -22,6 +23,10 @@ class HTMLPurifier_ErrorsHarness extends UnitTestCase
|
||||
$this->collector->expectOnce('send', $args);
|
||||
}
|
||||
|
||||
function expectContext($key, $value) {
|
||||
$this->collector->expectContext($key, $value);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user