You are here

private function FeatureContext::generateRandomTaxonomyString in Pantheon Advanced Page Cache 8

Generates a long string of tags used on node add form.

1 call to FeatureContext::generateRandomTaxonomyString()
FeatureContext::whenIGenerateAnArticleWithLotsOfTerms in tests/behat/helper_classes/Contexts/FeatureContext.php
@When a generate an article with lots of terms

File

tests/behat/helper_classes/Contexts/FeatureContext.php, line 170

Class

FeatureContext
Define application features from the specific context.

Namespace

PantheonSystems\CDNBehatHelpers\Contexts

Code

private function generateRandomTaxonomyString() {
  $letters = explode(' ', 'a b c d e f g h i j k l m n o p q r s t u v w x y z');
  $i = 0;
  $random_three_letter_combos = array();
  while ($i < 250) {
    $random_three_letter_combos[] = $letters[rand(0, 25)] . $letters[rand(0, 25)] . $letters[rand(0, 25)];
    $i++;
  }
  return implode(",", $random_three_letter_combos);
}