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() {
14 $this->config
= HTMLPurifier_Config
::create(array('Core.CollectErrors' => true));
15 $this->context
= new HTMLPurifier_Context();
16 generate_mock_once('HTMLPurifier_ErrorCollector');
17 $this->collector
= new HTMLPurifier_ErrorCollectorEMock();
18 $this->collector
->prepare($this->context
);
19 $this->context
->register('ErrorCollector', $this->collector
);
23 protected function expectNoErrorCollection() {
24 $this->collector
->expectNever('send');
27 protected function expectErrorCollection() {
28 $args = func_get_args();
29 $this->collector
->expectOnce('send', $args);
32 protected function expectContext($key, $value) {
33 $this->collector
->expectContext($key, $value);