You are here

protected function LocaleStringTest::buildSourceString in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/locale/tests/src/Kernel/LocaleStringTest.php \Drupal\Tests\locale\Kernel\LocaleStringTest::buildSourceString()
  2. 9 core/modules/locale/tests/src/Kernel/LocaleStringTest.php \Drupal\Tests\locale\Kernel\LocaleStringTest::buildSourceString()

Creates random source string object.

Parameters

array $values: The values array.

Return value

\Drupal\locale\StringInterface A locale string.

File

core/modules/locale/tests/src/Kernel/LocaleStringTest.php, line 194

Class

LocaleStringTest
Tests the locale string storage, string objects and data API.

Namespace

Drupal\Tests\locale\Kernel

Code

protected function buildSourceString(array $values = []) {
  return $this->storage
    ->createString($values += [
    'source' => $this
      ->randomMachineName(100),
    'context' => $this
      ->randomMachineName(20),
  ]);
}