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