Release 2.1.0, merged in 1313 to HEAD.
[htmlpurifier.git] / tests / HTMLPurifier / ErrorsHarness.php
blob67f7c6b3ae8fd113bbb547ecb216f83d51c4302c
1 <?php
3 require_once 'HTMLPurifier/ErrorCollectorEMock.php';
4 require_once 'HTMLPurifier/Lexer/DirectLex.php';
6 class HTMLPurifier_ErrorsHarness extends HTMLPurifier_Harness
9 var $config, $context;
10 var $collector, $generator;
12 function setup() {
13 $this->config = HTMLPurifier_Config::create(array('Core.CollectErrors' => true));
14 $this->context = new HTMLPurifier_Context();
15 generate_mock_once('HTMLPurifier_ErrorCollector');
16 $this->collector = new HTMLPurifier_ErrorCollectorEMock();
17 $this->collector->prepare($this->context);
18 $this->context->register('ErrorCollector', $this->collector);
21 function expectErrorCollection() {
22 $args = func_get_args();
23 $this->collector->expectOnce('send', $args);
26 function expectContext($key, $value) {
27 $this->collector->expectContext($key, $value);