You are here

public function LocaleStringTest::buildSourceString in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/locale/src/Tests/LocaleStringTest.php \Drupal\locale\Tests\LocaleStringTest::buildSourceString()

Creates random source string object.

Return value

\Drupal\locale\StringInterface A locale string.

1 call to LocaleStringTest::buildSourceString()
LocaleStringTest::testStringCRUDAPI in core/modules/locale/src/Tests/LocaleStringTest.php
Test CRUD API.

File

core/modules/locale/src/Tests/LocaleStringTest.php, line 179
Contains \Drupal\locale\Tests\LocaleStringTest.

Class

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

Namespace

Drupal\locale\Tests

Code

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