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