function MediaLibraryAddFormTest::testFormStateValidation
Same name in other branches
- 8.9.x core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php \Drupal\Tests\media_library\Kernel\MediaLibraryAddFormTest::testFormStateValidation()
- 10 core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php \Drupal\Tests\media_library\Kernel\MediaLibraryAddFormTest::testFormStateValidation()
- 11.x core/modules/media_library/tests/src/Kernel/MediaLibraryAddFormTest.php \Drupal\Tests\media_library\Kernel\MediaLibraryAddFormTest::testFormStateValidation()
Tests the validation of the library state in the media library add form.
File
-
core/
modules/ media_library/ tests/ src/ Kernel/ MediaLibraryAddFormTest.php, line 122
Class
- MediaLibraryAddFormTest
- Tests the media library add form.
Namespace
Drupal\Tests\media_library\KernelCode
public function testFormStateValidation() {
$form_state = new FormState();
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('The media library state is not present in the form state.');
\Drupal::formBuilder()->buildForm(FileUploadForm::class, $form_state);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.