You are here

private function PollTestBase::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 PollTestBase::generateChoices()
PollTestBase::pollCreate in tests/src/Functional/PollTestBase.php
Creates a poll.

File

tests/src/Functional/PollTestBase.php, line 179

Class

PollTestBase
Defines a base class for testing the Poll module.

Namespace

Drupal\Tests\poll\Functional

Code

private function generateChoices($count = 7) {
  $choices = array();
  for ($i = 1; $i <= $count; $i++) {
    $choices[] = $this
      ->randomMachineName();
  }
  return $choices;
}