public function WebformOptionsHelperTest::providerHasOption in Webform 6.x
Same name and namespace in other branches
- 8.5 tests/src/Unit/Utility/WebformOptionsHelperTest.php \Drupal\Tests\webform\Unit\Utility\WebformOptionsHelperTest::providerHasOption()
Data provider for testHasOption().
See also
testHasOption()
File
- tests/
src/ Unit/ Utility/ WebformOptionsHelperTest.php, line 41
Class
- WebformOptionsHelperTest
- Tests webform options utility.
Namespace
Drupal\Tests\webform\Unit\UtilityCode
public function providerHasOption() {
$tests[] = [
'value',
[
'value' => 'text',
],
TRUE,
];
$tests[] = [
'value',
[],
FALSE,
];
$tests[] = [
3,
[
1 => 'One',
2 => 'Two',
'optgroup' => [
3 => 'Three',
],
],
TRUE,
];
$tests[] = [
'3',
[
1 => 'One',
2 => 'Two',
'optgroup' => [
3 => 'Three',
],
],
TRUE,
];
$tests[] = [
'optgroup',
[
1 => 'One',
2 => 'Two',
'optgroup' => [
3 => 'Three',
],
],
FALSE,
];
return $tests;
}