public function FormStateValuesTraitTest::testHasValue in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Form/FormStateValuesTraitTest.php \Drupal\Tests\Core\Form\FormStateValuesTraitTest::testHasValue()
@covers ::hasValue
@dataProvider providerHasValue
File
- core/tests/ Drupal/ Tests/ Core/ Form/ FormStateValuesTraitTest.php, line 150 
Class
- FormStateValuesTraitTest
- @coversDefaultClass \Drupal\Core\Form\FormStateValuesTrait
Namespace
Drupal\Tests\Core\FormCode
public function testHasValue($key, $expected) {
  $form_state = (new FormStateValuesTraitStub())
    ->setValues([
    'foo' => 'one',
    'bar' => [
      'baz' => 'two',
    ],
    'true' => TRUE,
    'false' => FALSE,
    'null' => NULL,
  ]);
  $this
    ->assertSame($expected, $form_state
    ->hasValue($key));
}