You are here

public function MetatagTestBase::randomMachineName in Metatag 7

Generate a string that is allowable as a machine name.

Parameters

int $length: How long the machine name will be, defaults to eight characters.

Return value

string A string that contains lowercase letters and numbers, with a letter as the first character.

3 calls to MetatagTestBase::randomMachineName()
MetatagHreflangTagsTest::getTestTagValue in metatag_hreflang/tests/MetatagHreflangTagsTest.test
Generate a random value for testing meta tag fields.
MetatagTagsTestBase::getTestTagValue in tests/MetatagTagsTestBase.test
Generate a random value for testing meta tag fields.
MetatagTagsTestBase::randomImageUrl in tests/MetatagTagsTestBase.test
Generate a URL for an image.

File

tests/MetatagTestBase.test, line 785
A base class for the Metatag tests, provides shared methods.

Class

MetatagTestBase
A base class for the Metatag tests, provides shared methods.

Code

public function randomMachineName($length = 8) {
  return strtolower($this
    ->randomName($length));
}