function FeedAdminDisplayTest::randomMachineName

Same name and namespace in other branches
  1. 8.9.x 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

File

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

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.