function LocaleStringTest::buildSourceString
Same name in other branches
- 9 core/modules/locale/tests/src/Kernel/LocaleStringTest.php \Drupal\Tests\locale\Kernel\LocaleStringTest::buildSourceString()
- 8.9.x core/modules/locale/tests/src/Kernel/LocaleStringTest.php \Drupal\Tests\locale\Kernel\LocaleStringTest::buildSourceString()
- 11.x 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.
1 call to LocaleStringTest::buildSourceString()
- LocaleStringTest::testStringCrudApi in core/
modules/ locale/ tests/ src/ Kernel/ LocaleStringTest.php - Tests CRUD API.
File
-
core/
modules/ locale/ tests/ src/ Kernel/ LocaleStringTest.php, line 196
Class
- LocaleStringTest
- Tests the locale string storage, string objects and data API.
Namespace
Drupal\Tests\locale\KernelCode
protected function buildSourceString(array $values = []) {
return $this->storage
->createString($values += [
'source' => $this->randomMachineName(100),
'context' => $this->randomMachineName(20),
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.