You are here

public function YamlFormOptionsHelperTest::providerGetOptionsText in YAML Form 8

Data provider for testGetOptionsText().

See also

testGetOptionsText()

File

tests/src/Unit/YamlFormOptionsHelperTest.php, line 89

Class

YamlFormOptionsHelperTest
Tests form options utility.

Namespace

Drupal\Tests\yamlform\Unit

Code

public function providerGetOptionsText() {
  $tests[] = [
    [
      'value',
    ],
    [
      'value' => 'text',
    ],
    [
      'text',
    ],
  ];
  $tests[] = [
    [
      1,
      3,
    ],
    [
      1 => 'One',
      2 => 'Two',
      'optgroup' => [
        3 => 'Three',
      ],
    ],
    [
      'One',
      'Three',
    ],
  ];
  return $tests;
}