public function make($string)
{
if (strlen($string) > 2 && $string[0] == 's' && $string[1] == ':') {
$string = substr($string, 2);
$sensitive = true;
} else {
$sensitive = false;
}
$values = explode(',', $string);
return new HTMLPurifier_AttrDef_Enum($values, $sensitive);
}
function test_make() { $factory = new HTMLPurifier_AttrDef_Enum(); $def = $factory->make('foo,bar'); $def2 = new HTMLPurifier_AttrDef_Enum(array('foo', 'bar')); $this->assertIdentical($def, $def2); $def = $factory->make('s:foo,BAR'); $def2 = new HTMLPurifier_AttrDef_Enum(array('foo', 'BAR'), true); $this->assertIdentical($def, $def2); }