You are here

public function YamlFormOptionsHelperTest::providerHasOption in YAML Form 8

Data provider for testHasOption().

See also

testHasOption()

File

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

Class

YamlFormOptionsHelperTest
Tests form options utility.

Namespace

Drupal\Tests\yamlform\Unit

Code

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