'managed_file', ]; return $form; } /** * {@inheritdoc} */ public function validateForm(array &$form, FormStateInterface $form_state) {} /** * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) {} /** * Tests that managed file elements can be programmatically submitted. */ public function testManagedFileElement(): void { $form_state = new FormState(); $values['managed_file'] = NULL; $form_state->setValues($values); $this->container->get('form_builder')->submitForm($this, $form_state); // Should submit without any errors. $this->assertEquals(0, count($form_state->getErrors())); } }