obj = new HTMLPurifier_ChildDef_Custom('(a,b?,c*,d+,(a,b)*)');
$this->assertEqual($this->obj->elements, array('a' => true,
'b' => true, 'c' => true, 'd' => true));
$this->assertResult('', false);
$this->assertResult('', false);
$this->assertResult('');
$this->assertResult('Dobfoo'.
'foo');
}
function testNesting() {
$this->obj = new HTMLPurifier_ChildDef_Custom('(a,b,(c|d))+');
$this->assertEqual($this->obj->elements, array('a' => true,
'b' => true, 'c' => true, 'd' => true));
$this->assertResult('', false);
$this->assertResult('');
$this->assertResult('', false);
}
function testNestedEitherOr() {
$this->obj = new HTMLPurifier_ChildDef_Custom('b,(a|(c|d))+');
$this->assertEqual($this->obj->elements, array('a' => true,
'b' => true, 'c' => true, 'd' => true));
$this->assertResult('', false);
$this->assertResult('');
$this->assertResult('');
$this->assertResult('');
$this->assertResult('', false);
}
function testNestedQuantifier() {
$this->obj = new HTMLPurifier_ChildDef_Custom('(b,c+)*');
$this->assertEqual($this->obj->elements, array('b' => true, 'c' => true));
$this->assertResult('');
$this->assertResult('');
$this->assertResult('');
$this->assertResult('');
$this->assertResult('', false);
}
function testEitherOr() {
$this->obj = new HTMLPurifier_ChildDef_Custom('a|b');
$this->assertEqual($this->obj->elements, array('a' => true, 'b' => true));
$this->assertResult('', false);
$this->assertResult('');
$this->assertResult('');
$this->assertResult('', false);
}
function testCommafication() {
$this->obj = new HTMLPurifier_ChildDef_Custom('a,b');
$this->assertEqual($this->obj->elements, array('a' => true, 'b' => true));
$this->assertResult('');
$this->assertResult(' ', false);
}
}
?>