FileElementTest.php in Drupal 10
File
core/modules/system/tests/src/Kernel/Form/FileElementTest.php
View source
<?php
namespace Drupal\Tests\system\Kernel\Form;
use Drupal\form_test\Form\FormTestFileForm;
use Drupal\KernelTests\KernelTestBase;
class FileElementTest extends KernelTestBase {
protected static $modules = [
'form_test',
];
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']);
}
}