public function OtherEventVariablesTest::testFormEvent in Hook Event Dispatcher 3.x
Same name and namespace in other branches
- 8.2 modules/preprocess_event_dispatcher/tests/src/Unit/OtherEventVariablesTest.php \Drupal\Tests\preprocess_event_dispatcher\Unit\OtherEventVariablesTest::testFormEvent()
Test FormPreprocessEvent.
File
- modules/
preprocess_event_dispatcher/ tests/ src/ Unit/ OtherEventVariablesTest.php, line 120
Class
- OtherEventVariablesTest
- Class OtherEventVariablesTest.
Namespace
Drupal\Tests\preprocess_event_dispatcher\UnitCode
public function testFormEvent() : void {
$variablesArray = $this
->createVariablesArray();
$variablesArray['element'] = [
'element array',
];
/** @var \Drupal\preprocess_event_dispatcher\Variables\FormEventVariables $variables */
$variables = $this
->getVariablesFromCreatedEvent(FormPreprocessEvent::class, $variablesArray);
self::assertInstanceOf(FormEventVariables::class, $variables);
$this
->assertAbstractEventVariables($variables);
self::assertSame([
'element array',
], $variables
->getElement());
}