3 class HTMLPurifier_VarParserHarness
extends UnitTestCase
8 public function setup()
10 $class = substr(get_class($this), 0, -4);
11 $this->parser
= new $class();
14 public function assertValid($var, $type, $ret = null)
16 $ret = ($ret === null) ?
$var : $ret;
17 $this->assertIdentical($this->parser
->parse($var, $type), $ret);
20 public function assertInvalid($var, $type, $msg = null)
24 $this->parser
->parse($var, $type);
25 } catch (HTMLPurifier_VarParserException
$e) {
27 if ($msg !== null) $this->assertIdentical($e->getMessage(), $msg);
30 $this->fail('Did not catch expected error');