function FormStateValuesTraitTest::providerGetValue

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Form/FormStateValuesTraitTest.php \Drupal\Tests\Core\Form\FormStateValuesTraitTest::providerGetValue()
  2. 8.9.x core/tests/Drupal/Tests/Core/Form/FormStateValuesTraitTest.php \Drupal\Tests\Core\Form\FormStateValuesTraitTest::providerGetValue()
  3. 11.x core/tests/Drupal/Tests/Core/Form/FormStateValuesTraitTest.php \Drupal\Tests\Core\Form\FormStateValuesTraitTest::providerGetValue()

Provides data to
" class="local">self::testGetValue
().

Return value

array[] Items are arrays of two items:

  • The key for which to get the value (string)
  • The expected value (mixed).
  • The default value (mixed).

File

core/tests/Drupal/Tests/Core/Form/FormStateValuesTraitTest.php, line 65

Class

FormStateValuesTraitTest
@coversDefaultClass \Drupal\Core\Form\FormStateValuesTrait[[api-linebreak]]

Namespace

Drupal\Tests\Core\Form

Code

public static function providerGetValue() {
  $data = [];
  $data[] = [
    'foo',
    'one',
  ];
  $data[] = [
    [
      'bar',
      'baz',
    ],
    'two',
  ];
  $data[] = [
    [
      'foo',
      'bar',
      'baz',
    ],
    NULL,
  ];
  $data[] = [
    'baz',
    'baz',
    'baz',
  ];
  $data[] = [
    NULL,
    [
      'foo' => 'one',
      'bar' => [
        'baz' => 'two',
      ],
    ],
  ];
  return $data;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.