private function PollVoteJavascriptTest::generateChoices in Poll 8
Generates random choices for the poll.
Parameters
int $count: (optional) The number of choices to generate. Defaults to 7.
Return value
array $choices An array of generated choices.
1 call to PollVoteJavascriptTest::generateChoices()
- PollVoteJavascriptTest::pollCreate in tests/
src/ FunctionalJavascript/ PollVoteJavascriptTest.php - Creates a poll.
File
- tests/
src/ FunctionalJavascript/ PollVoteJavascriptTest.php, line 171
Class
- PollVoteJavascriptTest
- Tests voting on a poll using Javascript.
Namespace
Drupal\Tests\poll\FunctionalJavascriptCode
private function generateChoices($count = 7) {
$choices = [];
for ($i = 1; $i <= $count; $i++) {
$choices[] = $this
->randomMachineName();
}
return $choices;
}