Prepended constants with C_ to avoid reserved words as per https://www.php.net/manual...
[htmlpurifier/darkodev.git] / tests / HTMLPurifier / ErrorsHarness.php
blob4e38fed028b5d5ce1f0b66cfec10b6ecde1641e3
1 <?php
3 /**
4 * @todo Make the callCount variable actually work, so we can precisely
5 * specify what errors we want: no more, no less
6 */
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);
21 $this->callCount = 0;
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);
42 // vim: et sw=4 sts=4