Handle case when IDNAs are supported.
[htmlpurifier/darkodev.git] / tests / HTMLPurifier / AttrDefHarness.php
blob583cf0221a9dd1db65e867eec6379345381ce86b
1 <?php
3 class HTMLPurifier_AttrDefHarness extends HTMLPurifier_Harness
6 protected $def;
7 protected $context, $config;
9 public function setUp()
11 $this->config = HTMLPurifier_Config::createDefault();
12 $this->context = new HTMLPurifier_Context();
15 // cannot be used for accumulator
16 public function assertDef($string, $expect = true, $or_false = false)
18 // $expect can be a string or bool
19 $result = $this->def->validate($string, $this->config, $this->context);
20 if ($expect === true) {
21 if (!($or_false && $result === false)) {
22 $this->assertIdentical($string, $result);
24 } else {
25 if (!($or_false && $result === false)) {
26 $this->assertIdentical($expect, $result);
33 // vim: et sw=4 sts=4