public function SelectOtherInstallTestScript::getRandomOption in CCK Select Other 8
Gets a random option in a list of options.
Parameters
array $options: An array of list options.
Return value
array An indexed array of the key and value.
1 call to SelectOtherInstallTestScript::getRandomOption()
- SelectOtherInstallTestScript::setup in tests/
src/ TestSite/ SelectOtherInstallTestScript.php - Run the code to setup the test environment.
File
- tests/
src/ TestSite/ SelectOtherInstallTestScript.php, line 245
Class
- SelectOtherInstallTestScript
- Setup file used for cck_select_other Nightwatch tests.
Namespace
Drupal\Tests\cck_select_other\TestSiteCode
public function getRandomOption(array $options) {
$option = array_rand($options);
return [
$option,
$options[$option],
];
}