Improve auto-paragraph to preserve newlines and handle edge-cases better.
[htmlpurifier.git] / tests / HTMLPurifier / ErrorsHarness.php
blob61785cbf75a98e37832c71114691d14b2554cb5a
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() {
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);
20 $this->callCount = 0;
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);