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