public function FileElementTest::testFileElement in Drupal 10
Same name and namespace in other branches
- 8 core/modules/system/tests/src/Kernel/Form/FileElementTest.php \Drupal\Tests\system\Kernel\Form\FileElementTest::testFileElement()
- 9 core/modules/system/tests/src/Kernel/Form/FileElementTest.php \Drupal\Tests\system\Kernel\Form\FileElementTest::testFileElement()
Tests that file elements are built and processed correctly.
File
- core/
modules/ system/ tests/ src/ Kernel/ Form/ FileElementTest.php, line 23
Class
- FileElementTest
- Tests for the 'file' form element.
Namespace
Drupal\Tests\system\Kernel\FormCode
public function testFileElement() {
$form = $this->container
->get('form_builder')
->getForm(FormTestFileForm::class);
$this
->assertSame('file', $form['file']['#type']);
$this
->assertTrue($form['file']['#multiple']);
$this
->assertContains('cagatio', $form['file']['#attributes']['class']);
}