public function test_loadArrayFromForm()
{
$this->schema->add('Pancake.Mix', 'buttermilk', 'string', false);
$this->schema->add('Pancake.Served', true, 'bool', false);
$this->schema->add('Toppings.Syrup', true, 'bool', false);
$this->schema->add('Toppings.Flavor', 'maple', 'string', false);
$this->schema->add('Toppings.Strawberries', 3, 'int', false);
$this->schema->add('Toppings.Calories', 2000, 'int', true);
$this->schema->add('Toppings.DefinitionID', null, 'string', true);
$this->schema->add('Toppings.DefinitionRev', 1, 'int', false);
$this->schema->add('Toppings.Protected', 1, 'int', false);
$get = array('breakfast' => array('Pancake.Mix' => 'nasty', 'Pancake.Served' => '0', 'Toppings.Syrup' => '0', 'Toppings.Flavor' => "juice", 'Toppings.Strawberries' => '999', 'Toppings.Calories' => '', 'Null_Toppings.Calories' => '1', 'Toppings.DefinitionID' => '<argh>', 'Toppings.DefinitionRev' => '65', 'Toppings.Protected' => '4'));
$config_expect = HTMLPurifier_Config::create(array('Pancake.Served' => false, 'Toppings.Syrup' => false, 'Toppings.Flavor' => "juice", 'Toppings.Strawberries' => 999, 'Toppings.Calories' => null), $this->schema);
$config_result = HTMLPurifier_Config::loadArrayFromForm($get, 'breakfast', array('Pancake.Served', 'Toppings', '-Toppings.Protected'), false, $this->schema);
$this->assertEqual($config_expect, $config_result);
/*
MAGIC QUOTES NOT TESTED!!!
$get = array(
'breakfast' => array(
'Pancake.Mix' => 'n\\asty'
)
);
$config_expect = HTMLPurifier_Config::create(array(
'Pancake.Mix' => 'n\\asty'
));
$config_result = HTMLPurifier_Config::loadArrayFromForm($get, 'breakfast', true, false);
$this->assertEqual($config_expect, $config_result);
*/
}