function ConditionPluginBaseTest::testValidateConfigurationForm
Same name and namespace in other branches
- 11.x core/tests/Drupal/Tests/Core/Condition/ConditionPluginBaseTest.php \Drupal\Tests\Core\Condition\ConditionPluginBaseTest::testValidateConfigurationForm()
Tests that the negate form value is cast to a boolean on validation.
Attributes
#[DataProvider('providerTestValidateConfigurationForm')]
File
-
core/
tests/ Drupal/ Tests/ Core/ Condition/ ConditionPluginBaseTest.php, line 24
Class
Namespace
Drupal\Tests\Core\ConditionCode
public function testValidateConfigurationForm(mixed $value, bool $expected) : void {
$condition = new TestConditionPluginBase([], '', '');
$form = [];
$form_state = new FormState();
$form_state->setValue('negate', $value);
$condition->validateConfigurationForm($form, $form_state);
$this->assertSame($expected, $form_state->getValue('negate'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.