You are here

public function FormStateTest::testIsValueEmpty in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Form/FormStateTest.php \Drupal\Tests\Core\Form\FormStateTest::testIsValueEmpty()

@covers ::isValueEmpty

@dataProvider providerTestIsValueEmpty

File

core/tests/Drupal/Tests/Core/Form/FormStateTest.php, line 306
Contains \Drupal\Tests\Core\Form\FormStateTest.

Class

FormStateTest
@coversDefaultClass \Drupal\Core\Form\FormState

Namespace

Drupal\Tests\Core\Form

Code

public function testIsValueEmpty($key, $expected) {
  $form_state = (new FormState())
    ->setValues([
    'foo' => 'one',
    'bar' => array(
      'baz' => 'two',
    ),
    'true' => TRUE,
    'false' => FALSE,
    'null' => NULL,
  ]);
  $this
    ->assertSame($expected, $form_state
    ->isValueEmpty($key));
}