function FormStateValuesTraitTest::testSetValue
Same name and namespace in other branches
- 10 core/tests/Drupal/Tests/Core/Form/FormStateValuesTraitTest.php \Drupal\Tests\Core\Form\FormStateValuesTraitTest::testSetValue()
- 9 core/tests/Drupal/Tests/Core/Form/FormStateValuesTraitTest.php \Drupal\Tests\Core\Form\FormStateValuesTraitTest::testSetValue()
- 8.9.x core/tests/Drupal/Tests/Core/Form/FormStateValuesTraitTest.php \Drupal\Tests\Core\Form\FormStateValuesTraitTest::testSetValue()
Tests set value.
@legacy-covers ::setValue
Attributes
#[DataProvider('providerSetValue')]
File
-
core/
tests/ Drupal/ Tests/ Core/ Form/ FormStateValuesTraitTest.php, line 122
Class
Namespace
Drupal\Tests\Core\FormCode
public function testSetValue($key, $value, $expected) : void {
$form_state = (new FormStateValuesTraitStub())->setValues([
'bar' => 'wrong',
]);
$form_state->setValue($key, $value);
$this->assertSame($expected, $form_state->getValues());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.