public function WebformOptionsHelperTest::testHasOption in Webform 8.5
Same name and namespace in other branches
- 6.x tests/src/Unit/Utility/WebformOptionsHelperTest.php \Drupal\Tests\webform\Unit\Utility\WebformOptionsHelperTest::testHasOption()
Tests WebformOptionsHelper::hasOption().
@dataProvider providerHasOption
Parameters
string $value: The value to run through WebformOptionsHelper::hasOption().
array $options: The array to run through WebformOptionsHelper::hasOption().
string $expected: The expected result from calling the function.
See also
WebformOptionsHelper::hasOption()
File
- tests/
src/ Unit/ Utility/ WebformOptionsHelperTest.php, line 31
Class
- WebformOptionsHelperTest
- Tests webform options utility.
Namespace
Drupal\Tests\webform\Unit\UtilityCode
public function testHasOption($value, array $options, $expected) {
$result = WebformOptionsHelper::hasOption($value, $options);
$this
->assertEquals($expected, $result);
}