public function AbstractFormEntityDisplayEditAlterEventSubscriberTestCase::testFormAlterTwoFields in Hook Event Dispatcher 3.x
Same name and namespace in other branches
- 8.2 modules/field_event_dispatcher/tests/src/Unit/Field/AbstractFormEntityDisplayEditAlterEventSubscriberTestCase.php \Drupal\Tests\field_event_dispatcher\Unit\Field\AbstractFormEntityDisplayEditAlterEventSubscriberTestCase::testFormAlterTwoFields()
FormEntityDisplayEditAlterEventSubscriber test with two fields.
This tests that FormEntityDisplayEditAlterEventSubscriber::formAlter() alters the $form array as expected when two fields are provided.
File
- modules/
field_event_dispatcher/ tests/ src/ Unit/ Field/ AbstractFormEntityDisplayEditAlterEventSubscriberTestCase.php, line 147
Class
- AbstractFormEntityDisplayEditAlterEventSubscriberTestCase
- Class AbstractFormEntityDisplayEditAlterEventSubscriberTestCase.
Namespace
Drupal\Tests\field_event_dispatcher\Unit\FieldCode
public function testFormAlterTwoFields() : void {
$form = $this
->getTestForm([
'field_test1' => [
'test_module' => [
'test',
],
],
'field_test2' => [
'test_module' => [
'test',
],
],
]);
$expectedForm = $form;
$this
->alterForm($form, $expectedForm);
self::assertSame($expectedForm, $form);
}