4 * @todo Make the callCount variable actually work, so we can precisely
5 * specify what errors we want: no more, no less
7 class HTMLPurifier_ErrorsHarness
extends HTMLPurifier_Harness
10 protected $config, $context;
11 protected $collector, $generator, $callCount;
13 public function setup()
15 $this->config
= HTMLPurifier_Config
::create(array('Core.CollectErrors' => true));
16 $this->context
= new HTMLPurifier_Context();
17 generate_mock_once('HTMLPurifier_ErrorCollector');
18 $this->collector
= new HTMLPurifier_ErrorCollectorEMock();
19 $this->collector
->prepare($this->context
);
20 $this->context
->register('ErrorCollector', $this->collector
);
24 protected function expectNoErrorCollection()
26 $this->collector
->expectNever('send');
29 protected function expectErrorCollection()
31 $args = func_get_args();
32 $this->collector
->expectOnce('send', $args);
35 protected function expectContext($key, $value)
37 $this->collector
->expectContext($key, $value);