You are here

public function FormHelperTest::providerElements in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Form/FormHelperTest.php \Drupal\Tests\Core\Form\FormHelperTest::providerElements()
  2. 10 core/tests/Drupal/Tests/Core/Form/FormHelperTest.php \Drupal\Tests\Core\Form\FormHelperTest::providerElements()

Provides a list of elements to test.

File

core/tests/Drupal/Tests/Core/Form/FormHelperTest.php, line 100

Class

FormHelperTest
@coversDefaultClass \Drupal\Core\Form\FormHelper @group Form

Namespace

Drupal\Tests\Core\Form

Code

public function providerElements() {
  return [
    [
      [
        '#type' => 'date',
        '#states' => [
          'visible' => [
            ':input[name="toggle_me"]' => [
              'checked' => TRUE,
            ],
          ],
        ],
      ],
      '#attributes',
    ],
    [
      [
        '#type' => 'item',
        '#states' => [
          'visible' => [
            ':input[name="foo"]' => [
              'value' => 'bar',
            ],
          ],
        ],
      ],
      '#wrapper_attributes',
    ],
  ];
}