Commit 80eccb18 authored by alexpott's avatar alexpott

Issue #2361823 by rpayanm, javivf: Remove usage of drupal_strtolower().

parent 51fcd31c
......@@ -8,6 +8,7 @@
namespace Drupal\Core\Database\Driver\pgsql;
use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\Query\Condition;
use Drupal\Core\Database\SchemaObjectExistsException;
......@@ -294,7 +295,7 @@ protected function processField($field) {
// Set the correct database-engine specific datatype.
// In case one is already provided, force it to lowercase.
if (isset($field['pgsql_type'])) {
$field['pgsql_type'] = drupal_strtolower($field['pgsql_type']);
$field['pgsql_type'] = Unicode::strtolower($field['pgsql_type']);
}
else {
$map = $this->getFieldTypeMap();
......
......@@ -165,7 +165,7 @@ public function testBlockDelete() {
// Place the block.
$instance = array(
'id' => drupal_strtolower($edit['info[0][value]']),
'id' => Unicode::strtolower($edit['info[0][value]']),
'settings[label]' => $edit['info[0][value]'],
'region' => 'sidebar_first',
);
......
......@@ -6,6 +6,7 @@
*/
namespace Drupal\block_content\Tests;
use Drupal\Component\Utility\Unicode;
/**
* Tests block fieldability.
......@@ -55,7 +56,7 @@ public function testBlockFields() {
// Create a field with settings to validate.
$this->fieldStorage = entity_create('field_storage_config', array(
'field_name' => drupal_strtolower($this->randomMachineName()),
'field_name' => Unicode::strtolower($this->randomMachineName()),
'entity_type' => 'block_content',
'type' => 'link',
'cardinality' => 2,
......@@ -93,7 +94,7 @@ public function testBlockFields() {
$url = 'admin/structure/block/add/block_content:' . $block->uuid() . '/' . \Drupal::config('system.theme')->get('default');
// Place the block.
$instance = array(
'id' => drupal_strtolower($edit['info[0][value]']),
'id' => Unicode::strtolower($edit['info[0][value]']),
'settings[label]' => $edit['info[0][value]'],
'region' => 'sidebar_first',
);
......
......@@ -6,6 +6,7 @@
*/
namespace Drupal\block_content\Tests;
use Drupal\Component\Utility\Unicode;
/**
* Create a block and test block edit functionality.
......@@ -24,7 +25,7 @@ public function testPageEdit() {
$body_key = 'body[0][value]';
// Create block to edit.
$edit = array();
$edit['info[0][value]'] = drupal_strtolower($this->randomMachineName(8));
$edit['info[0][value]'] = Unicode::strtolower($this->randomMachineName(8));
$edit[$body_key] = $this->randomMachineName(16);
$this->drupalPostForm('block/add/basic', $edit, t('Save'));
......
......@@ -4,6 +4,7 @@
* Allows users to change the color scheme of themes.
*/
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Asset\CssOptimizer;
use Drupal\Component\Utility\Bytes;
use Drupal\Component\Utility\Environment;
......@@ -515,7 +516,7 @@ function _color_rewrite_stylesheet($theme, &$info, &$paths, $palette, $style) {
// Prepare color conversion table.
$conversion = $palette;
foreach ($conversion as $k => $v) {
$conversion[$k] = drupal_strtolower($v);
$conversion[$k] = Unicode::strtolower($v);
}
$default = color_get_palette($theme, TRUE);
......@@ -534,7 +535,7 @@ function _color_rewrite_stylesheet($theme, &$info, &$paths, $palette, $style) {
// Iterate over all the parts.
foreach ($style as $chunk) {
if ($is_color) {
$chunk = drupal_strtolower($chunk);
$chunk = Unicode::strtolower($chunk);
// Check if this is one of the colors in the default palette.
if ($key = array_search($chunk, $default)) {
$chunk = $conversion[$key];
......
......@@ -7,6 +7,7 @@
namespace Drupal\config\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Archiver\ArchiveTar;
use Drupal\simpletest\WebTestBase;
......@@ -63,7 +64,7 @@ public function testExportImport() {
$this->content_type = $this->drupalCreateContentType();
// Create a field.
$this->fieldName = drupal_strtolower($this->randomMachineName());
$this->fieldName = Unicode::strtolower($this->randomMachineName());
$this->fieldStorage = entity_create('field_storage_config', array(
'field_name' => $this->fieldName,
'entity_type' => 'node',
......
......@@ -107,13 +107,13 @@ function testSiteWideContact() {
$recipients = array('simpletest@example.com', 'simpletest2@example.com', 'simpletest3@example.com');
$max_length = EntityTypeInterface::BUNDLE_MAX_LENGTH;
$max_length_exceeded = $max_length + 1;
$this->addContactForm($id = drupal_strtolower($this->randomMachineName($max_length_exceeded)), $label = $this->randomMachineName($max_length_exceeded), implode(',', array($recipients[0])), '', TRUE);
$this->addContactForm($id = Unicode::strtolower($this->randomMachineName($max_length_exceeded)), $label = $this->randomMachineName($max_length_exceeded), implode(',', array($recipients[0])), '', TRUE);
$this->assertText(format_string('Machine-readable name cannot be longer than !max characters but is currently !exceeded characters long.', array('!max' => $max_length, '!exceeded' => $max_length_exceeded)));
$this->addContactForm($id = drupal_strtolower($this->randomMachineName($max_length)), $label = $this->randomMachineName($max_length), implode(',', array($recipients[0])), '', TRUE);
$this->addContactForm($id = Unicode::strtolower($this->randomMachineName($max_length)), $label = $this->randomMachineName($max_length), implode(',', array($recipients[0])), '', TRUE);
$this->assertRaw(t('Contact form %label has been added.', array('%label' => $label)));
// Create first valid form.
$this->addContactForm($id = drupal_strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', array($recipients[0])), '', TRUE);
$this->addContactForm($id = Unicode::strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', array($recipients[0])), '', TRUE);
$this->assertRaw(t('Contact form %label has been added.', array('%label' => $label)));
// Check that the form was created in site default language.
......@@ -148,10 +148,10 @@ function testSiteWideContact() {
$this->drupalLogin($admin_user);
// Add more forms.
$this->addContactForm(drupal_strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', array($recipients[0], $recipients[1])), '', FALSE);
$this->addContactForm(Unicode::strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', array($recipients[0], $recipients[1])), '', FALSE);
$this->assertRaw(t('Contact form %label has been added.', array('%label' => $label)));
$this->addContactForm($name = drupal_strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', array($recipients[0], $recipients[1], $recipients[2])), '', FALSE);
$this->addContactForm($name = Unicode::strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', array($recipients[0], $recipients[1], $recipients[2])), '', FALSE);
$this->assertRaw(t('Contact form %label has been added.', array('%label' => $label)));
// Try adding a form that already exists.
......@@ -221,7 +221,7 @@ function testSiteWideContact() {
$label = $this->randomMachineName(16);
$recipients = implode(',', array($recipients[0], $recipients[1], $recipients[2]));
$contact_form = drupal_strtolower($this->randomMachineName(16));
$contact_form = Unicode::strtolower($this->randomMachineName(16));
$this->addContactForm($contact_form, $label, $recipients, '', FALSE);
$this->drupalGet('admin/structure/contact');
$this->clickLink(t('Edit'));
......
......@@ -7,6 +7,7 @@
namespace Drupal\contact\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\config\Tests\SchemaCheckTestTrait;
use Drupal\contact\Entity\Message;
......@@ -53,7 +54,7 @@ public function testContactStorage() {
$this->drupalLogin($admin_user);
// Create first valid contact form.
$mail = 'simpletest@example.com';
$this->addContactForm($id = drupal_strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', array($mail)), '', TRUE, [
$this->addContactForm($id = Unicode::strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', array($mail)), '', TRUE, [
'send_a_pony' => 1,
]);
$this->assertRaw(t('Contact form %label has been added.', array('%label' => $label)));
......
......@@ -7,6 +7,7 @@
namespace Drupal\datetime\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\Entity\EntityViewDisplay;
use Drupal\simpletest\WebTestBase;
use Drupal\Core\Datetime\DrupalDateTime;
......@@ -52,7 +53,7 @@ protected function setUp() {
$this->drupalLogin($web_user);
// Create a field with settings to validate.
$field_name = drupal_strtolower($this->randomMachineName());
$field_name = Unicode::strtolower($this->randomMachineName());
$this->fieldStorage = entity_create('field_storage_config', array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
......@@ -283,7 +284,7 @@ function testDefaultValue() {
$this->drupalCreateContentType(array('type' => 'date_content'));
// Create a field storage with settings to validate.
$field_name = drupal_strtolower($this->randomMachineName());
$field_name = Unicode::strtolower($this->randomMachineName());
$field_storage = entity_create('field_storage_config', array(
'field_name' => $field_name,
'entity_type' => 'node',
......
......@@ -8,6 +8,7 @@
namespace Drupal\entity_reference;
use Drupal\Component\Utility\Tags;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Controller\ControllerBase;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\JsonResponse;
......@@ -86,7 +87,7 @@ public function handleAutocomplete(Request $request, $type, $field_name, $entity
// Get the typed string, if exists from the URL.
$items_typed = $request->query->get('q');
$items_typed = Tags::explode($items_typed);
$last_item = drupal_strtolower(array_pop($items_typed));
$last_item = Unicode::strtolower(array_pop($items_typed));
$prefix = '';
// The user entered a comma-separated list of entity labels, so we generate
......
......@@ -7,6 +7,7 @@
namespace Drupal\entity_reference\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\simpletest\WebTestBase;
/**
......@@ -42,7 +43,7 @@ function testEntityReferenceDefaultValue() {
// Create a node to be referenced.
$referenced_node = $this->drupalCreateNode(array('type' => 'referenced_content'));
$field_name = drupal_strtolower($this->randomMachineName());
$field_name = Unicode::strtolower($this->randomMachineName());
$field_storage = entity_create('field_storage_config', array(
'field_name' => $field_name,
'entity_type' => 'node',
......
......@@ -7,6 +7,7 @@
namespace Drupal\entity_reference\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Field\FieldItemListInterface;
use Drupal\Core\Field\FieldItemInterface;
use Drupal\Core\Language\LanguageInterface;
......@@ -51,7 +52,7 @@ protected function setUp() {
$this->vocabulary = entity_create('taxonomy_vocabulary', array(
'name' => $this->randomMachineName(),
'vid' => drupal_strtolower($this->randomMachineName()),
'vid' => Unicode::strtolower($this->randomMachineName()),
'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
));
$this->vocabulary->save();
......@@ -152,7 +153,7 @@ public function testConfigEntityReferenceItem() {
// Make sure the computed term reflects updates to the term id.
$vocabulary2 = entity_create('taxonomy_vocabulary', array(
'name' => $this->randomMachineName(),
'vid' => drupal_strtolower($this->randomMachineName()),
'vid' => Unicode::strtolower($this->randomMachineName()),
'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
));
$vocabulary2->save();
......
......@@ -7,6 +7,7 @@
namespace Drupal\field\Tests\Boolean;
use Drupal\Component\Utility\Unicode;
use Drupal\field\Entity\FieldStorageConfig;
use Drupal\field\Entity\FieldConfig;
use Drupal\simpletest\WebTestBase;
......@@ -63,7 +64,7 @@ function testBooleanField() {
$label = $this->randomMachineName();
// Create a field with settings to validate.
$field_name = drupal_strtolower($this->randomMachineName());
$field_name = Unicode::strtolower($this->randomMachineName());
$this->field_storage = FieldStorageConfig::create(array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
......
......@@ -7,6 +7,7 @@
namespace Drupal\field\Tests\Email;
use Drupal\Component\Utility\Unicode;
use Drupal\simpletest\WebTestBase;
/**
......@@ -53,7 +54,7 @@ protected function setUp() {
*/
function testEmailField() {
// Create a field with settings to validate.
$field_name = drupal_strtolower($this->randomMachineName());
$field_name = Unicode::strtolower($this->randomMachineName());
$this->fieldStorage = entity_create('field_storage_config', array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
......
......@@ -6,6 +6,7 @@
*/
namespace Drupal\field\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\field\Entity\FieldConfig;
/**
......@@ -282,7 +283,7 @@ function testEntityCreateRenameBundle() {
$cardinality = $this->fieldTestData->field_storage->getCardinality();
// Create a new bundle.
$new_bundle = 'test_bundle_' . drupal_strtolower($this->randomMachineName());
$new_bundle = 'test_bundle_' . Unicode::strtolower($this->randomMachineName());
entity_test_create_bundle($new_bundle, NULL, $entity_type);
// Add a field to that bundle.
......@@ -299,7 +300,7 @@ function testEntityCreateRenameBundle() {
$this->assertEqual(count($entity->{$this->fieldTestData->field_name}), $cardinality, "Data is retrieved for the new bundle");
// Rename the bundle.
$new_bundle = 'test_bundle_' . drupal_strtolower($this->randomMachineName());
$new_bundle = 'test_bundle_' . Unicode::strtolower($this->randomMachineName());
entity_test_rename_bundle($this->fieldTestData->field_definition['bundle'], $new_bundle, $entity_type);
// Check that the field definition has been updated.
......@@ -321,7 +322,7 @@ function testEntityDeleteBundle() {
$this->createFieldWithStorage('', $entity_type);
// Create a new bundle.
$new_bundle = 'test_bundle_' . drupal_strtolower($this->randomMachineName());
$new_bundle = 'test_bundle_' . Unicode::strtolower($this->randomMachineName());
entity_test_create_bundle($new_bundle, NULL, $entity_type);
// Add a field to that bundle.
......@@ -329,7 +330,7 @@ function testEntityDeleteBundle() {
entity_create('field_config', $this->fieldTestData->field_definition)->save();
// Create a second field for the test bundle
$field_name = drupal_strtolower($this->randomMachineName() . '_field_name');
$field_name = Unicode::strtolower($this->randomMachineName() . '_field_name');
$field_storage = array(
'field_name' => $field_name,
'entity_type' => $entity_type,
......
......@@ -7,6 +7,7 @@
namespace Drupal\field\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\EntityStorageException;
use Drupal\Core\Field\FieldException;
use Drupal\field\Entity\FieldStorageConfig;
......@@ -44,7 +45,7 @@ function setUp() {
parent::setUp();
$this->fieldStorageDefinition = array(
'field_name' => drupal_strtolower($this->randomMachineName()),
'field_name' => Unicode::strtolower($this->randomMachineName()),
'entity_type' => 'entity_test',
'type' => 'test_field',
);
......
......@@ -7,6 +7,7 @@
namespace Drupal\field\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\simpletest\KernelTestBase;
......@@ -89,7 +90,7 @@ protected function createFieldWithStorage($suffix = '', $entity_type = 'entity_t
$field = 'field' . $suffix;
$field_definition = 'field_definition' . $suffix;
$this->fieldTestData->$field_name = drupal_strtolower($this->randomMachineName() . '_field_name' . $suffix);
$this->fieldTestData->$field_name = Unicode::strtolower($this->randomMachineName() . '_field_name' . $suffix);
$this->fieldTestData->$field_storage = entity_create('field_storage_config', array(
'field_name' => $this->fieldTestData->$field_name,
'entity_type' => $entity_type,
......
......@@ -7,6 +7,7 @@
namespace Drupal\field\Tests\Number;
use Drupal\Component\Utility\Unicode;
use Drupal\simpletest\WebTestBase;
/**
......@@ -42,7 +43,7 @@ protected function setUp() {
*/
function testNumberDecimalField() {
// Create a field with settings to validate.
$field_name = drupal_strtolower($this->randomMachineName());
$field_name = Unicode::strtolower($this->randomMachineName());
entity_create('field_storage_config', array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
......@@ -132,7 +133,7 @@ function testNumberIntegerField() {
$maximum = rand(2000, 4000);
// Create a field with settings to validate.
$field_name = drupal_strtolower($this->randomMachineName());
$field_name = Unicode::strtolower($this->randomMachineName());
entity_create('field_storage_config', array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
......@@ -226,7 +227,7 @@ function testNumberIntegerField() {
*/
function testNumberFloatField() {
// Create a field with settings to validate.
$field_name = drupal_strtolower($this->randomMachineName());
$field_name = Unicode::strtolower($this->randomMachineName());
entity_create('field_storage_config', array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
......@@ -311,9 +312,9 @@ function testNumberFloatField() {
* Test default formatter behavior
*/
function testNumberFormatter() {
$type = drupal_strtolower($this->randomMachineName());
$float_field = drupal_strtolower($this->randomMachineName());
$integer_field = drupal_strtolower($this->randomMachineName());
$type = Unicode::strtolower($this->randomMachineName());
$float_field = Unicode::strtolower($this->randomMachineName());
$integer_field = Unicode::strtolower($this->randomMachineName());
$thousand_separators = array('', '.', ',', ' ', chr(8201), "'");
$decimal_separators = array('.', ',');
$prefix = $this->randomMachineName();
......
......@@ -7,6 +7,7 @@
namespace Drupal\field\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\language\Entity\ConfigurableLanguage;
/**
......@@ -75,7 +76,7 @@ protected function setUp() {
$this->installConfig(array('language'));
$this->field_name = drupal_strtolower($this->randomMachineName());
$this->field_name = Unicode::strtolower($this->randomMachineName());
$this->entity_type = 'entity_test';
......@@ -138,7 +139,7 @@ function testTranslatableFieldSaveLoad() {
}
// Test default values.
$field_name_default = drupal_strtolower($this->randomMachineName() . '_field_name');
$field_name_default = Unicode::strtolower($this->randomMachineName() . '_field_name');
$field_storage_definition = $this->field_storage_definition;
$field_storage_definition['field_name'] = $field_name_default;
$field_storage = entity_create('field_storage_config', $field_storage_definition);
......
......@@ -7,6 +7,7 @@
namespace Drupal\field\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\language\Entity\ConfigurableLanguage;
/**
......@@ -54,7 +55,7 @@ class TranslationWebTest extends FieldTestBase {
protected function setUp() {
parent::setUp();
$this->field_name = drupal_strtolower($this->randomMachineName() . '_field_name');
$this->field_name = Unicode::strtolower($this->randomMachineName() . '_field_name');
$field_storage = array(
'field_name' => $this->field_name,
......
......@@ -7,6 +7,7 @@
namespace Drupal\field_ui\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Language\LanguageInterface;
use Drupal\simpletest\WebTestBase;
......@@ -38,7 +39,7 @@ protected function setUp() {
$vocabulary = entity_create('taxonomy_vocabulary', array(
'name' => $this->randomMachineName(),
'description' => $this->randomMachineName(),
'vid' => drupal_strtolower($this->randomMachineName()),
'vid' => Unicode::strtolower($this->randomMachineName()),
'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
'help' => '',
'nodes' => array('article' => 'article'),
......
......@@ -8,6 +8,7 @@
namespace Drupal\filter\Tests;
use Drupal\Component\Utility\String;
use Drupal\Component\Utility\Unicode;
use Drupal\simpletest\WebTestBase;
/**
......@@ -98,7 +99,7 @@ function testFormatAdmin() {
// Add text format.
$this->drupalGet('admin/config/content/formats');
$this->clickLink('Add text format');
$format_id = drupal_strtolower($this->randomMachineName());
$format_id = Unicode::strtolower($this->randomMachineName());
$name = $this->randomMachineName();
$edit = array(
'format' => $format_id,
......@@ -231,7 +232,7 @@ function testFilterAdmin() {
// Add format.
$edit = array();
$edit['format'] = drupal_strtolower($this->randomMachineName());
$edit['format'] = Unicode::strtolower($this->randomMachineName());
$edit['name'] = $this->randomMachineName();
$edit['roles[' . DRUPAL_AUTHENTICATED_RID . ']'] = 1;
$edit['filters[' . $second_filter . '][status]'] = TRUE;
......
......@@ -7,6 +7,7 @@
namespace Drupal\filter\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\simpletest\WebTestBase;
/**
......@@ -34,7 +35,7 @@ function testDefaultTextFormats() {
$formats = array();
for ($i = 0; $i < 2; $i++) {
$edit = array(
'format' => drupal_strtolower($this->randomMachineName()),
'format' => Unicode::strtolower($this->randomMachineName()),
'name' => $this->randomMachineName(),
);
$this->drupalPostForm('admin/config/content/formats/add', $edit, t('Save configuration'));
......
......@@ -7,6 +7,7 @@
namespace Drupal\filter\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Access\AccessResult;
use Drupal\simpletest\WebTestBase;
......@@ -86,7 +87,7 @@ protected function setUp() {
$formats = array();
for ($i = 0; $i < 3; $i++) {
$edit = array(
'format' => drupal_strtolower($this->randomMachineName()),
'format' => Unicode::strtolower($this->randomMachineName()),
'name' => $this->randomMachineName(),
);
$this->drupalPostForm('admin/config/content/formats/add', $edit, t('Save configuration'));
......
......@@ -7,6 +7,7 @@
namespace Drupal\filter\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\simpletest\WebTestBase;
/**
......@@ -41,7 +42,7 @@ function testFilterHooks() {
// Add a text format.
$name = $this->randomMachineName();
$edit = array();
$edit['format'] = drupal_strtolower($this->randomMachineName());
$edit['format'] = Unicode::strtolower($this->randomMachineName());
$edit['name'] = $name;
$edit['roles[' . DRUPAL_ANONYMOUS_RID . ']'] = 1;
$this->drupalPostForm('admin/config/content/formats/add', $edit, t('Save configuration'));
......
......@@ -6,6 +6,7 @@
*/
namespace Drupal\image\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\file\Entity\File;
/**
......@@ -300,7 +301,7 @@ public function testDefaultImages() {
*/
public function testInvalidDefaultImage() {
$field_storage = entity_create('field_storage_config', array(
'field_name' => drupal_strtolower($this->randomMachineName()),
'field_name' => Unicode::strtolower($this->randomMachineName()),
'entity_type' => 'node',
'type' => 'image',
'settings' => array(
......
......@@ -62,7 +62,7 @@ protected function setUp() {
* Tests link field URL validation.
*/
function testURLValidation() {
$field_name = drupal_strtolower($this->randomMachineName());
$field_name = Unicode::strtolower($this->randomMachineName());
// Create a field with settings to validate.
$this->fieldStorage = entity_create('field_storage_config', array(
'field_name' => $field_name,
......@@ -182,7 +182,7 @@ protected function assertInvalidEntries($field_name, array $invalid_entries) {
* Tests the link title settings of a link field.
*/
function testLinkTitle() {
$field_name = drupal_strtolower($this->randomMachineName());
$field_name = Unicode::strtolower($this->randomMachineName());
// Create a field with settings to validate.
$this->fieldStorage = entity_create('field_storage_config', array(
'field_name' => $field_name,
......@@ -296,7 +296,7 @@ function testLinkTitle() {
* Tests the default 'link' formatter.
*/
function testLinkFormatter() {
$field_name = drupal_strtolower($this->randomMachineName());
$field_name = Unicode::strtolower($this->randomMachineName());
// Create a field with settings to validate.
$this->fieldStorage = entity_create('field_storage_config', array(
'field_name' => $field_name,
......@@ -436,7 +436,7 @@ function testLinkFormatter() {
* merged, since they involve different configuration and output.
*/
function testLinkSeparateFormatter() {
$field_name = drupal_strtolower($this->randomMachineName());
$field_name = Unicode::strtolower($this->randomMachineName());
// Create a field with settings to validate.
$this->fieldStorage = entity_create('field_storage_config', array(
'field_name' => $field_name,
......
......@@ -7,6 +7,7 @@
namespace Drupal\link\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\simpletest\WebTestBase;
/**
......@@ -40,7 +41,7 @@ function testFieldUI() {
// Add a link field to the newly-created type.
$label = $this->randomMachineName();
$field_name = drupal_strtolower($label);
$field_name = Unicode::strtolower($label);
$edit = array(
'fields[_add_new_field][label]' => $label,
'fields[_add_new_field][field_name]' => $field_name,
......
......@@ -6,6 +6,7 @@
*/
namespace Drupal\node\Tests;
use Drupal\Component\Utility\Unicode;
/**
* Tests the persistence of basic options through multiple steps.
......@@ -30,7 +31,7 @@ function testMultiStepNodeFormBasicOptions() {
$this->drupalLogin($web_user);
// Create an unlimited cardinality field.
$this->field_name = drupal_strtolower($this->randomMachineName());
$this->field_name = Unicode::strtolower($this->randomMachineName());
entity_create('field_storage_config', array(
'field_name' => $this->field_name,
'entity_type' => 'node',
......
......@@ -6,6 +6,7 @@
*/
namespace Drupal\node\Tests;
use Drupal\Component\Utility\Unicode;
/**
* Tests the interaction of the node access system with fields.
......@@ -52,7 +53,7 @@ protected function setUp() {
$this->content_admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer node fields'));
// Add a custom field to the page content type.
$this->field_name = drupal_strtolower($this->randomMachineName() . '_field_name');
$this->field_name = Unicode::strtolower($this->randomMachineName() . '_field_name');
entity_create('field_storage_config', array(
'field_name' => $this->field_name,
'entity_type' => 'node',
......
......@@ -7,6 +7,7 @@
namespace Drupal\node\Tests;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Language\LanguageInterface;
use Drupal\node\Entity\NodeType;
......@@ -61,7 +62,7 @@ protected function setUp() {
$this->term = $term;
// Create a field.
$this->field_name = drupal_strtolower($this->randomMachineName());
$this->field_name = Unicode::strtolower($this->randomMachineName());
entity_create('field_storage_config', array(
'field_name' => $this->field_name,
'entity_type' => 'node',
......
......@@ -6,6 +6,7 @@
namespace Drupal\rdf\Tests\Field;
use Drupal\Component\Utility\Unicode;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\user\Entity\Role;
......@@ -48,7 +49,7 @@ protected function setUp() {
$vocabulary = entity_create('taxonomy_vocabulary', array(
'name' => $this->randomMachineName(),
'vid' => drupal_strtolower($this->randomMachineName()),
'vid' => Unicode::strtolower($this->randomMachineName()),
'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
));
$vocabulary->