You are here

public function FeedAdminDisplayTest::randomMachineName in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/aggregator/tests/src/Functional/FeedAdminDisplayTest.php \Drupal\Tests\aggregator\Functional\FeedAdminDisplayTest::randomMachineName()

Generates a unique random string containing letters and numbers.

Do not use this method when testing unvalidated user input. Instead, use \Drupal\simpletest\TestBase::randomString().

Parameters

int $length: Length of random string to generate.

Return value

string Randomly generated unique string.

Overrides RandomGeneratorTrait::randomMachineName

See also

\Drupal\Component\Utility\Random::name()

File

core/modules/aggregator/tests/src/Functional/FeedAdminDisplayTest.php, line 71

Class

FeedAdminDisplayTest
Tests the display of a feed on the Aggregator list page.

Namespace

Drupal\Tests\aggregator\Functional

Code

public function randomMachineName($length = 8) {
  $value = parent::randomMachineName($length);

  // See expected values in testFeedUpdateFields().
  $value = str_replace([
    'never',
    'imminently',
    'ago',
    'left',
  ], 'x', $value);
  return $value;
}