function ManagedFileTest::testManagedFileElement

Same name and namespace in other branches
  1. 9 core/modules/file/tests/src/Kernel/ManagedFileTest.php \Drupal\Tests\file\Kernel\ManagedFileTest::testManagedFileElement()
  2. 11.x core/modules/file/tests/src/Kernel/ManagedFileTest.php \Drupal\Tests\file\Kernel\ManagedFileTest::testManagedFileElement()

Tests that managed file elements can be programmatically submitted.

File

core/modules/file/tests/src/Kernel/ManagedFileTest.php, line 50

Class

ManagedFileTest
Managed file element test.

Namespace

Drupal\Tests\file\Kernel

Code

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()));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.