/** * Test that parsing and composing a valid URI returns the same URI * * @param array $posts * @param AbstractField[] $fields * @param string $getValueName * * @dataProvider formValueProvider */ public function testGetValue(array $posts, array $fields, string $getValueName) { self::request()->setPosts($posts); self::request()->setMethod('POST'); $form = new Form(); foreach ($fields as $field) { $form->add($field); } $this->assertEquals($form->getValue($getValueName), $posts[$getValueName]); }
/** * {@inheritdoc} */ protected function populateValue($element) : bool { $return = parent::populateValue($element); if (!$return && $this->isSubmit()) { $this->addErrorClass($element); } return $return; }
/** * @param Form $form */ public function onAdd(Form $form) { $form->setMultipart(); }