From b175481f32a86d2b1e204e4a05029b1868c23a7a Mon Sep 17 00:00:00 2001
From: Lauri Eskola <lauri.eskola@acquia.com>
Date: Tue, 1 Aug 2023 21:32:45 +0300
Subject: [PATCH] Issue #3376281 by Indrapatil, nlisgo, longwave, smustgrave:
 Random machine names no longer need to be wrapped in strtolower()

---
 .../src/Functional/BlockHookOperationTest.php |  2 +-
 .../src/Functional/BlockLanguageTest.php      |  4 ++--
 .../block/tests/src/Functional/BlockTest.php  | 12 +++++------
 .../tests/src/Functional/BlockUiTest.php      |  2 +-
 .../src/Functional/Views/DisplayBlockTest.php |  2 +-
 .../src/Kernel/BlockConfigSchemaTest.php      |  2 +-
 .../src/Kernel/NewDefaultThemeBlocksTest.php  |  6 +++---
 .../tests/src/Traits/BlockCreationTrait.php   |  2 +-
 .../src/Functional/BlockContentTestBase.php   |  2 +-
 .../BlockContentTranslationUITest.php         |  2 +-
 .../tests/src/Functional/PageEditTest.php     |  2 +-
 .../Functional/Views/BlockContentTestBase.php |  2 +-
 .../Views/BlockContentWizardTest.php          |  2 +-
 .../src/Functional/CommentInterfaceTest.php   |  2 +-
 .../tests/src/Functional/Views/WizardTest.php |  4 ++--
 .../src/Kernel/CommentIntegrationTest.php     |  4 ++--
 .../Functional/ConfigEntityStatusUITest.php   |  2 +-
 .../tests/src/Functional/ConfigEntityTest.php |  6 +++---
 .../Functional/ConfigExportImportUITest.php   |  2 +-
 .../Functional/ConfigTranslationCacheTest.php |  4 ++--
 .../ConfigTranslationListUiTest.php           | 20 +++++++++----------
 .../Functional/ConfigTranslationUiTest.php    |  8 ++++----
 .../src/Functional/ContactSitewideTest.php    | 14 ++++++-------
 .../src/Functional/ContactStorageTest.php     |  2 +-
 .../src/Kernel/Views/ContactFieldsTest.php    |  2 +-
 .../tests/src/Functional/DateTestBase.php     |  4 ++--
 .../src/Functional/DateTimeFieldTest.php      |  4 ++--
 .../src/Functional/DateRangeFieldTest.php     |  4 ++--
 .../tests/src/Kernel/DateRangeItemTest.php    |  2 +-
 .../src/Kernel/SeparatorTranslationTest.php   |  2 +-
 .../tests/src/Functional/EditorAdminTest.php  |  2 +-
 .../Kernel/EditorFilterIntegrationTest.php    |  2 +-
 .../Functional/Boolean/BooleanFieldTest.php   |  2 +-
 .../Boolean/BooleanFormatterSettingsTest.php  |  4 ++--
 .../src/Functional/Email/EmailFieldTest.php   |  2 +-
 .../EntityReferenceAdminTest.php              |  6 +++---
 .../EntityReferenceAutoCreateTest.php         |  6 +++---
 .../EntityReferenceFieldDefaultValueTest.php  |  4 ++--
 .../FunctionalString/StringFieldTest.php      |  2 +-
 .../src/Functional/Number/NumberFieldTest.php | 10 +++++-----
 .../src/Functional/TranslationWebTest.php     |  2 +-
 .../Boolean/BooleanFormatterSettingsTest.php  |  4 ++--
 .../EntityReferenceAdminTest.php              |  4 ++--
 .../Number/NumberFieldTest.php                |  6 +++---
 .../Kernel/Boolean/BooleanFormatterTest.php   |  2 +-
 .../EntityReferenceItemTest.php               |  6 +++---
 .../EntityReferenceSettingsTest.php           | 10 +++++-----
 .../EntityReference/Views/SelectionTest.php   |  2 +-
 .../src/Kernel/FieldAttachStorageTest.php     |  6 +++---
 .../field/tests/src/Kernel/FieldCrudTest.php  |  4 ++--
 .../tests/src/Kernel/FieldDisplayTest.php     |  2 +-
 .../tests/src/Kernel/FieldFormatterTest.php   |  2 +-
 .../tests/src/Kernel/FieldKernelTestBase.php  |  2 +-
 .../KernelString/RawStringFormatterTest.php   |  2 +-
 .../KernelString/StringFormatterTest.php      |  2 +-
 .../Timestamp/TimestampFormatterTest.php      |  2 +-
 .../tests/src/Kernel/TranslationTest.php      |  4 ++--
 .../tests/src/Kernel/Uri/UriItemTest.php      |  2 +-
 .../src/Functional/EntityDisplayModeTest.php  |  8 ++++----
 .../src/Functional/FieldUIDeleteTest.php      |  4 ++--
 .../src/Functional/ManageDisplayTest.php      |  4 ++--
 .../Functional/ManageFieldsFunctionalTest.php | 10 +++++-----
 .../ManageDisplayTest.php                     |  2 +-
 .../tests/src/Kernel/EntityDisplayTest.php    |  4 ++--
 .../src/Functional/FileFieldDisplayTest.php   |  8 ++++----
 .../FileFieldFormatterAccessTest.php          |  2 +-
 .../src/Functional/FileFieldPathTest.php      |  2 +-
 .../Functional/FileFieldRSSContentTest.php    |  2 +-
 .../src/Functional/FileFieldRevisionTest.php  |  2 +-
 .../src/Functional/FileFieldValidateTest.php  |  6 +++---
 .../src/Functional/FileFieldWidgetTest.php    | 14 ++++++-------
 .../Functional/FileOnTranslatedEntityTest.php |  2 +-
 .../tests/src/Functional/FilePrivateTest.php  |  2 +-
 .../src/Functional/FileTokenReplaceTest.php   |  2 +-
 .../Formatter/FileMediaFormatterTestBase.php  |  2 +-
 .../PrivateFileOnTranslatedEntityTest.php     |  2 +-
 .../FileFieldValidateTest.php                 |  2 +-
 .../tests/src/Functional/FilterAdminTest.php  |  8 ++++----
 .../Functional/FilterDefaultFormatTest.php    |  2 +-
 .../src/Functional/FilterFormatAccessTest.php |  2 +-
 .../tests/src/Functional/FilterHooksTest.php  |  4 ++--
 .../src/Functional/ImageAdminStylesTest.php   | 16 +++++++--------
 .../ImageFieldDefaultImagesTest.php           |  4 ++--
 .../src/Functional/ImageFieldDisplayTest.php  | 10 +++++-----
 .../src/Functional/ImageFieldValidateTest.php | 10 +++++-----
 .../src/Functional/ImageFieldWidgetTest.php   |  2 +-
 .../ImageOnTranslatedEntityTest.php           |  2 +-
 .../src/Functional/ImageStyleFlushTest.php    |  2 +-
 .../ImageAdminStylesTest.php                  |  2 +-
 .../ImageFieldValidateTest.php                |  2 +-
 .../tests/src/Kernel/ImageFormatterTest.php   |  2 +-
 .../ConfigurableLanguageManagerTest.php       |  4 ++--
 .../tests/src/Functional/LinkFieldTest.php    | 12 +++++------
 .../src/Functional/MediaTypeCreationTest.php  |  2 +-
 .../MediaViewsWizardTest.php                  |  4 ++--
 .../src/Functional/MenuUiLanguageTest.php     |  2 +-
 .../tests/src/Functional/MenuUiTest.php       |  6 +++---
 .../MenuUiJavascriptTest.php                  |  2 +-
 .../MigrateEntityContentValidationTest.php    |  2 +-
 .../MultiStepNodeFormBasicOptionsTest.php     |  2 +-
 .../src/Functional/NodeAccessFieldTest.php    |  2 +-
 .../Functional/NodeBlockFunctionalTest.php    |  2 +-
 .../Functional/NodeTypeTranslationTest.php    |  6 +++---
 .../tests/src/Functional/PagePreviewTest.php  |  2 +-
 ...enTaxonomyTermReferenceFieldWizardTest.php |  2 +-
 .../Views/Wizard/NodeRevisionWizardTest.php   |  4 ++--
 .../src/Traits/ContentTypeCreationTrait.php   |  2 +-
 .../src/Functional/OptionsFieldUITest.php     |  4 ++--
 .../ResponsiveImageFieldDisplayTest.php       |  8 ++++----
 .../ResponsiveImageFieldUiTest.php            |  2 +-
 .../SearchConfigSettingsFormTest.php          | 10 +++++-----
 .../src/Functional/ShortcutLinksTest.php      |  2 +-
 .../tests/src/Functional/ShortcutSetsTest.php |  4 ++--
 .../tests/src/Functional/ShortcutTestBase.php |  2 +-
 .../Module/PrepareUninstallTest.php           |  4 ++--
 .../System/DateFormatsMachineNameTest.php     |  2 +-
 .../src/Functional/System/DateTimeTest.php    |  6 +++---
 ...ityReferenceSelectionReferenceableTest.php |  8 ++++----
 .../src/Functional/TermAutocompleteTest.php   |  2 +-
 .../tests/src/Functional/TermIndexTest.php    |  4 ++--
 .../Functional/Views/TaxonomyTermViewTest.php |  2 +-
 .../src/Functional/VocabularyLanguageTest.php |  4 ++--
 .../Functional/VocabularyTranslationTest.php  |  4 ++--
 .../tests/src/Functional/VocabularyUiTest.php |  4 ++--
 .../Kernel/TermHierarchyValidationTest.php    |  2 +-
 .../tests/src/Kernel/VocabularyCrudTest.php   |  2 +-
 .../tests/src/Traits/TaxonomyTestTrait.php    |  2 +-
 .../tests/src/Functional/TextFieldTest.php    | 14 ++++++-------
 .../TextareaWithSummaryTest.php               |  2 +-
 .../tests/src/Kernel/TextItemBaseTest.php     |  2 +-
 .../Condition/UserRoleConditionTest.php       |  2 +-
 .../src/Kernel/UserActionConfigSchemaTest.php |  2 +-
 .../src/Kernel/UserEntityReferenceTest.php    |  4 ++--
 .../tests/src/Kernel/UserRoleDeleteTest.php   |  4 ++--
 .../tests/src/Traits/UserCreationTrait.php    |  2 +-
 .../tests/src/Functional/DefaultViewsTest.php |  4 ++--
 .../Plugin/ExposedFormCheckboxesTest.php      |  2 +-
 .../tests/src/Functional/Wizard/BasicTest.php | 12 +++++------
 .../Wizard/EntityTestRevisionTest.php         |  2 +-
 .../Functional/Wizard/ItemsPerPageTest.php    |  2 +-
 .../tests/src/Functional/Wizard/MenuTest.php  |  2 +-
 .../src/Functional/Wizard/NodeWizardTest.php  |  2 +-
 .../tests/src/Functional/Wizard/PagerTest.php |  2 +-
 .../src/Functional/Wizard/SortingTest.php     |  4 ++--
 .../src/Functional/Wizard/TaggedWithTest.php  |  4 ++--
 .../Entity/ViewEntityDependenciesTest.php     |  2 +-
 .../Kernel/Plugin/BlockDependenciesTest.php   |  2 +-
 .../Wizard/WizardPluginBaseKernelTest.php     |  2 +-
 .../tests/src/Functional/DefaultViewsTest.php |  2 +-
 .../tests/src/Functional/DisplayPathTest.php  |  2 +-
 .../tests/src/Functional/DuplicateTest.php    |  2 +-
 .../tests/src/Functional/FieldUITest.php      |  2 +-
 .../Functional/NewViewConfigSchemaTest.php    |  2 +-
 .../src/Functional/OverrideDisplaysTest.php   |  6 +++---
 .../tests/src/Functional/PreviewTest.php      |  2 +-
 .../tests/src/Functional/SettingsTest.php     | 10 +++++-----
 .../tests/src/Functional/StyleTableTest.php   |  2 +-
 .../tests/src/Functional/UITestBase.php       |  2 +-
 .../tests/src/Functional/ViewsUITourTest.php  |  4 ++--
 .../tests/src/Functional/WizardTest.php       |  4 ++--
 .../tests/src/Functional/WorkspaceTest.php    |  2 +-
 .../src/Kernel/WorkspaceViewsKernelTest.php   |  2 +-
 .../Core/Config/ConfigEntityStatusTest.php    |  2 +-
 .../Config/ConfigEntityValidationTestBase.php |  2 +-
 .../Core/Config/ConfigImportRecreateTest.php  |  2 +-
 .../ConfigImportRenameValidationTest.php      |  2 +-
 .../Core/Entity/EntityLanguageTestBase.php    |  4 ++--
 .../Entity/EntityQueryRelationshipTest.php    |  4 ++--
 .../Core/Entity/EntityQueryTest.php           |  4 ++--
 .../Core/Entity/FieldSqlStorageTest.php       |  4 ++--
 .../KernelTests/Core/Field/FieldItemTest.php  |  2 +-
 .../Core/Field/FieldMissingTypeTest.php       |  2 +-
 .../Core/Extension/InfoParserUnitTest.php     |  2 +-
 173 files changed, 331 insertions(+), 331 deletions(-)

diff --git a/core/modules/block/tests/src/Functional/BlockHookOperationTest.php b/core/modules/block/tests/src/Functional/BlockHookOperationTest.php
index cb4030792272..925544415d5f 100644
--- a/core/modules/block/tests/src/Functional/BlockHookOperationTest.php
+++ b/core/modules/block/tests/src/Functional/BlockHookOperationTest.php
@@ -44,7 +44,7 @@ protected function setUp(): void {
   public function testBlockOperationAlter() {
     // Add a test block, any block will do.
     // Set the machine name so the test_operation link can be built later.
-    $block_id = mb_strtolower($this->randomMachineName(16));
+    $block_id = $this->randomMachineName(16);
     $this->drupalPlaceBlock('system_powered_by_block', ['id' => $block_id]);
 
     // Get the Block listing.
diff --git a/core/modules/block/tests/src/Functional/BlockLanguageTest.php b/core/modules/block/tests/src/Functional/BlockLanguageTest.php
index 95c2b3fa4df0..cd558073852b 100644
--- a/core/modules/block/tests/src/Functional/BlockLanguageTest.php
+++ b/core/modules/block/tests/src/Functional/BlockLanguageTest.php
@@ -79,7 +79,7 @@ public function testLanguageBlockVisibility() {
     // Enable a standard block and set the visibility setting for one language.
     $edit = [
       'visibility[language][langcodes][en]' => TRUE,
-      'id' => strtolower($this->randomMachineName(8)),
+      'id' => $this->randomMachineName(8),
       'region' => 'sidebar_first',
     ];
     $this->drupalGet('admin/structure/block/add/system_powered_by_block' . '/' . $default_theme);
@@ -165,7 +165,7 @@ public function testMultipleLanguageTypes() {
     $this->assertSession()->fieldExists('visibility[language][context_mapping][language]');
 
     // Enable a standard block and set visibility to French only.
-    $block_id = strtolower($this->randomMachineName(8));
+    $block_id = $this->randomMachineName(8);
     $edit = [
       'visibility[language][context_mapping][language]' => '@language.current_language_context:language_interface',
       'visibility[language][langcodes][fr]' => TRUE,
diff --git a/core/modules/block/tests/src/Functional/BlockTest.php b/core/modules/block/tests/src/Functional/BlockTest.php
index 4fc188a85e3a..e626f7e7f9fa 100644
--- a/core/modules/block/tests/src/Functional/BlockTest.php
+++ b/core/modules/block/tests/src/Functional/BlockTest.php
@@ -30,7 +30,7 @@ public function testBlockVisibility() {
     // Enable a standard block.
     $default_theme = $this->config('system.theme')->get('default');
     $edit = [
-      'id' => strtolower($this->randomMachineName(8)),
+      'id' => $this->randomMachineName(8),
       'region' => 'sidebar_first',
       'settings[label]' => $title,
       'settings[label_display]' => TRUE,
@@ -90,7 +90,7 @@ public function testBlockToggleVisibility() {
     // Enable a standard block.
     $default_theme = $this->config('system.theme')->get('default');
     $edit = [
-      'id' => strtolower($this->randomMachineName(8)),
+      'id' => $this->randomMachineName(8),
       'region' => 'sidebar_first',
       'settings[label]' => $title,
     ];
@@ -127,7 +127,7 @@ public function testBlockVisibilityListedEmpty() {
     // Enable a standard block.
     $default_theme = $this->config('system.theme')->get('default');
     $edit = [
-      'id' => strtolower($this->randomMachineName(8)),
+      'id' => $this->randomMachineName(8),
       'region' => 'sidebar_first',
       'settings[label]' => $title,
       'visibility[request_path][negate]' => TRUE,
@@ -187,7 +187,7 @@ public function testAddBlockFromLibraryWithWeight() {
 
       // Create a random title for the block.
       $title = $this->randomMachineName(8);
-      $block_id = strtolower($this->randomMachineName(8));
+      $block_id = $this->randomMachineName(8);
       $edit = [
         'id' => $block_id,
         'settings[label]' => $title,
@@ -304,7 +304,7 @@ public function testBlockThemeSelector() {
       $this->assertSession()->titleEquals('Block layout | Drupal');
       // Select the 'Powered by Drupal' block to be placed.
       $block = [];
-      $block['id'] = strtolower($this->randomMachineName());
+      $block['id'] = $this->randomMachineName();
       $block['theme'] = $theme;
       $block['region'] = 'content';
       $this->drupalGet('admin/structure/block/add/system_powered_by_block');
@@ -343,7 +343,7 @@ public function testHideBlockTitle() {
     $block_name = 'system_powered_by_block';
     // Create a random title for the block.
     $title = $this->randomMachineName(8);
-    $id = strtolower($this->randomMachineName(8));
+    $id = $this->randomMachineName(8);
     // Enable a standard block.
     $default_theme = $this->config('system.theme')->get('default');
     $edit = [
diff --git a/core/modules/block/tests/src/Functional/BlockUiTest.php b/core/modules/block/tests/src/Functional/BlockUiTest.php
index 882fadb9b039..28a4c476db9b 100644
--- a/core/modules/block/tests/src/Functional/BlockUiTest.php
+++ b/core/modules/block/tests/src/Functional/BlockUiTest.php
@@ -317,7 +317,7 @@ public function testBlockPlacementIndicator() {
 
     // Select the 'Powered by Drupal' block to be placed.
     $block = [];
-    $block['id'] = strtolower($this->randomMachineName());
+    $block['id'] = $this->randomMachineName();
     $block['theme'] = 'stark';
     $block['region'] = 'content';
 
diff --git a/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php b/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php
index 55f54f822d49..043474f07252 100644
--- a/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php
+++ b/core/modules/block/tests/src/Functional/Views/DisplayBlockTest.php
@@ -70,7 +70,7 @@ public function testBlockCategory() {
     // Create a new view in the UI.
     $edit = [];
     $edit['label'] = $this->randomString();
-    $edit['id'] = strtolower($this->randomMachineName());
+    $edit['id'] = $this->randomMachineName();
     $edit['show[wizard_key]'] = 'standard:views_test_data';
     $edit['description'] = $this->randomString();
     $edit['block[create]'] = TRUE;
diff --git a/core/modules/block/tests/src/Kernel/BlockConfigSchemaTest.php b/core/modules/block/tests/src/Kernel/BlockConfigSchemaTest.php
index 1f576125af39..7b61ab6f7077 100644
--- a/core/modules/block/tests/src/Kernel/BlockConfigSchemaTest.php
+++ b/core/modules/block/tests/src/Kernel/BlockConfigSchemaTest.php
@@ -65,7 +65,7 @@ protected function setUp(): void {
    */
   public function testBlockConfigSchema() {
     foreach ($this->blockManager->getDefinitions() as $block_id => $definition) {
-      $id = strtolower($this->randomMachineName());
+      $id = $this->randomMachineName();
       $block = Block::create([
         'id' => $id,
         'theme' => 'stark',
diff --git a/core/modules/block/tests/src/Kernel/NewDefaultThemeBlocksTest.php b/core/modules/block/tests/src/Kernel/NewDefaultThemeBlocksTest.php
index b2f099a49cad..06bf3544e4db 100644
--- a/core/modules/block/tests/src/Kernel/NewDefaultThemeBlocksTest.php
+++ b/core/modules/block/tests/src/Kernel/NewDefaultThemeBlocksTest.php
@@ -35,15 +35,15 @@ public function testNewDefaultThemeBlocks() {
 
     // Add two instances of the user login block.
     $this->placeBlock('user_login_block', [
-      'id' => $default_theme . '_' . strtolower($this->randomMachineName(8)),
+      'id' => $default_theme . '_' . $this->randomMachineName(8),
     ]);
     $this->placeBlock('user_login_block', [
-      'id' => $default_theme . '_' . strtolower($this->randomMachineName(8)),
+      'id' => $default_theme . '_' . $this->randomMachineName(8),
     ]);
 
     // Add an instance of a different block.
     $this->placeBlock('system_powered_by_block', [
-      'id' => $default_theme . '_' . strtolower($this->randomMachineName(8)),
+      'id' => $default_theme . '_' . $this->randomMachineName(8),
     ]);
 
     // Install a different theme that does not have blocks.
diff --git a/core/modules/block/tests/src/Traits/BlockCreationTrait.php b/core/modules/block/tests/src/Traits/BlockCreationTrait.php
index fe1bc3c92211..440f34c10da8 100644
--- a/core/modules/block/tests/src/Traits/BlockCreationTrait.php
+++ b/core/modules/block/tests/src/Traits/BlockCreationTrait.php
@@ -43,7 +43,7 @@ protected function placeBlock($plugin_id, array $settings = []) {
     $settings += [
       'plugin' => $plugin_id,
       'region' => 'content',
-      'id' => strtolower($this->randomMachineName(8)),
+      'id' => $this->randomMachineName(8),
       'theme' => $config->get('system.theme')->get('default'),
       'label' => $this->randomMachineName(8),
       'visibility' => [],
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentTestBase.php b/core/modules/block_content/tests/src/Functional/BlockContentTestBase.php
index c719e4a37821..17e5a223472e 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentTestBase.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentTestBase.php
@@ -108,7 +108,7 @@ protected function createBlockContentType($values, $create_body = FALSE) {
     if (is_array($values)) {
       if (!isset($values['id'])) {
         do {
-          $id = strtolower($this->randomMachineName(8));
+          $id = $this->randomMachineName(8);
         } while (BlockContentType::load($id));
       }
       else {
diff --git a/core/modules/block_content/tests/src/Functional/BlockContentTranslationUITest.php b/core/modules/block_content/tests/src/Functional/BlockContentTranslationUITest.php
index ae69ff101519..98d302dbc14b 100644
--- a/core/modules/block_content/tests/src/Functional/BlockContentTranslationUITest.php
+++ b/core/modules/block_content/tests/src/Functional/BlockContentTranslationUITest.php
@@ -88,7 +88,7 @@ public function getTranslatorPermissions() {
    * {@inheritdoc}
    */
   protected function getNewEntityValues($langcode) {
-    return ['info' => mb_strtolower($this->randomMachineName())] + parent::getNewEntityValues($langcode);
+    return ['info' => $this->randomMachineName()] + parent::getNewEntityValues($langcode);
   }
 
   /**
diff --git a/core/modules/block_content/tests/src/Functional/PageEditTest.php b/core/modules/block_content/tests/src/Functional/PageEditTest.php
index f2ae75d02c19..b45452b03dcf 100644
--- a/core/modules/block_content/tests/src/Functional/PageEditTest.php
+++ b/core/modules/block_content/tests/src/Functional/PageEditTest.php
@@ -39,7 +39,7 @@ public function testPageEdit() {
     $body_key = 'body[0][value]';
     // Create block to edit.
     $edit = [];
-    $edit['info[0][value]'] = mb_strtolower($this->randomMachineName(8));
+    $edit['info[0][value]'] = $this->randomMachineName(8);
     $edit[$body_key] = $this->randomMachineName(16);
     $this->drupalGet('block/add/basic');
     $this->submitForm($edit, 'Save');
diff --git a/core/modules/block_content/tests/src/Functional/Views/BlockContentTestBase.php b/core/modules/block_content/tests/src/Functional/Views/BlockContentTestBase.php
index b9222d93bb55..3482f7923c9a 100644
--- a/core/modules/block_content/tests/src/Functional/Views/BlockContentTestBase.php
+++ b/core/modules/block_content/tests/src/Functional/Views/BlockContentTestBase.php
@@ -88,7 +88,7 @@ protected function createBlockContentType(array $values = []) {
     // Find a non-existent random type name.
     if (!isset($values['id'])) {
       do {
-        $id = strtolower($this->randomMachineName(8));
+        $id = $this->randomMachineName(8);
       } while (BlockContentType::load($id));
     }
     else {
diff --git a/core/modules/block_content/tests/src/Functional/Views/BlockContentWizardTest.php b/core/modules/block_content/tests/src/Functional/Views/BlockContentWizardTest.php
index e68923b34237..de68b2aeb291 100644
--- a/core/modules/block_content/tests/src/Functional/Views/BlockContentWizardTest.php
+++ b/core/modules/block_content/tests/src/Functional/Views/BlockContentWizardTest.php
@@ -35,7 +35,7 @@ protected function setUp(): void {
   public function testViewAddBlockContent() {
     $view = [];
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['description'] = $this->randomMachineName(16);
     $view['page[create]'] = FALSE;
     $view['show[wizard_key]'] = 'block_content';
diff --git a/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php b/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php
index a68452a13bfc..ec5e319168dd 100644
--- a/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php
+++ b/core/modules/comment/tests/src/Functional/CommentInterfaceTest.php
@@ -309,7 +309,7 @@ public function testViewMode() {
     $this->assertSession()->responseContains('<p>' . $comment_text . '</p>');
 
     // Create a new comment entity view mode.
-    $mode = mb_strtolower($this->randomMachineName());
+    $mode = $this->randomMachineName();
     EntityViewMode::create([
       'targetEntityType' => 'comment',
       'id' => "comment.$mode",
diff --git a/core/modules/comment/tests/src/Functional/Views/WizardTest.php b/core/modules/comment/tests/src/Functional/Views/WizardTest.php
index c8b206134503..5252f833050a 100644
--- a/core/modules/comment/tests/src/Functional/Views/WizardTest.php
+++ b/core/modules/comment/tests/src/Functional/Views/WizardTest.php
@@ -44,7 +44,7 @@ protected function setUp($import_test_views = TRUE, $modules = []): void {
   public function testCommentWizard() {
     $view = [];
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['show[wizard_key]'] = 'comment';
     $view['page[create]'] = TRUE;
     $view['page[path]'] = $this->randomMachineName(16);
@@ -73,7 +73,7 @@ public function testCommentWizard() {
     }
     $this->assertEquals($expected_options, $actual_options);
 
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $this->submitForm($view, 'Save and edit');
     // Verify that the view saving was successful and the browser got redirected
     // to the edit page.
diff --git a/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php b/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php
index c098c0ccf35f..9e48bcd1e53b 100644
--- a/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php
+++ b/core/modules/comment/tests/src/Kernel/CommentIntegrationTest.php
@@ -58,7 +58,7 @@ protected function setUp(): void {
    * @see CommentDefaultFormatter::calculateDependencies()
    */
   public function testViewMode() {
-    $mode = mb_strtolower($this->randomMachineName());
+    $mode = $this->randomMachineName();
     // Create a new comment view mode and a view display entity.
     EntityViewMode::create([
       'id' => "comment.$mode",
@@ -75,7 +75,7 @@ public function testViewMode() {
     FieldStorageConfig::create([
       'entity_type' => 'entity_test',
       'type' => 'comment',
-      'field_name' => $field_name = mb_strtolower($this->randomMachineName()),
+      'field_name' => $field_name = $this->randomMachineName(),
       'settings' => [
         'comment_type' => 'comment',
       ],
diff --git a/core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php b/core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php
index e58aaa9a984d..b2bb975cce84 100644
--- a/core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php
+++ b/core/modules/config/tests/src/Functional/ConfigEntityStatusUITest.php
@@ -31,7 +31,7 @@ public function testCRUD() {
       'administer site configuration',
     ]));
 
-    $id = strtolower($this->randomMachineName());
+    $id = $this->randomMachineName();
     $edit = [
       'id' => $id,
       'label' => $this->randomMachineName(),
diff --git a/core/modules/config/tests/src/Functional/ConfigEntityTest.php b/core/modules/config/tests/src/Functional/ConfigEntityTest.php
index f2aff9521bb0..7f7c5e534f2a 100644
--- a/core/modules/config/tests/src/Functional/ConfigEntityTest.php
+++ b/core/modules/config/tests/src/Functional/ConfigEntityTest.php
@@ -230,7 +230,7 @@ public function testCrudUi() {
       'administer site configuration',
     ]));
 
-    $id = strtolower($this->randomMachineName());
+    $id = $this->randomMachineName();
     $label1 = $this->randomMachineName();
     $label2 = $this->randomMachineName();
     $label3 = $this->randomMachineName();
@@ -290,7 +290,7 @@ public function testCrudUi() {
 
     // Rename the configuration entity's ID/machine name.
     $edit = [
-      'id' => strtolower($this->randomMachineName()),
+      'id' => $this->randomMachineName(),
       'label' => $label3,
     ];
     $this->drupalGet("admin/structure/config_test/manage/{$id}");
@@ -326,7 +326,7 @@ public function testCrudUi() {
     // @see \Drupal\Tests\config\FunctionalJavascript\ConfigEntityTest::testAjaxOnAddPage()
     $this->drupalGet('admin/structure/config_test/add');
 
-    $id = strtolower($this->randomMachineName());
+    $id = $this->randomMachineName();
     $edit = [
       'id' => $id,
       'label' => $this->randomString(),
diff --git a/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php b/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php
index fa01655f679e..ee7ba633b644 100644
--- a/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php
+++ b/core/modules/config/tests/src/Functional/ConfigExportImportUITest.php
@@ -106,7 +106,7 @@ public function testExportImport() {
     $this->contentType = $this->drupalCreateContentType();
 
     // Create a field.
-    $this->fieldName = mb_strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
     $this->fieldStorage = FieldStorageConfig::create([
       'field_name' => $this->fieldName,
       'entity_type' => 'node',
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationCacheTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationCacheTest.php
index 182b36595594..440fa2f7f503 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationCacheTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationCacheTest.php
@@ -122,7 +122,7 @@ protected function setUp(): void {
   public function testFieldConfigTranslation() {
     // Add a test field which has a translatable field setting and a
     // translatable field storage setting.
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
@@ -133,7 +133,7 @@ public function testFieldConfigTranslation() {
     $field_storage->setSetting('translatable_storage_setting', $translatable_storage_setting);
     $field_storage->save();
 
-    $bundle = strtolower($this->randomMachineName());
+    $bundle = $this->randomMachineName();
     entity_test_create_bundle($bundle);
     $field = FieldConfig::create([
       'field_name' => $field_name,
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php
index 657ba9486e51..f7d921ff4af9 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php
@@ -104,7 +104,7 @@ protected function setUp(): void {
   protected function doBlockListTest() {
     // Add a test block, any block will do.
     // Set the machine name so the translate link can be built later.
-    $id = mb_strtolower($this->randomMachineName(16));
+    $id = $this->randomMachineName(16);
     $this->drupalPlaceBlock('system_powered_by_block', ['id' => $id]);
 
     // Get the Block listing.
@@ -127,7 +127,7 @@ protected function doMenuListTest() {
     // this does not test more than necessary.
     $this->drupalGet('admin/structure/menu/add');
     // Lowercase the machine name.
-    $menu_name = mb_strtolower($this->randomMachineName(16));
+    $menu_name = $this->randomMachineName(16);
     $label = $this->randomMachineName(16);
     $edit = [
       'id' => $menu_name,
@@ -176,7 +176,7 @@ protected function doVocabularyListTest() {
     $vocabulary = Vocabulary::create([
       'name' => $this->randomMachineName(),
       'description' => $this->randomMachineName(),
-      'vid' => mb_strtolower($this->randomMachineName()),
+      'vid' => $this->randomMachineName(),
     ]);
     $vocabulary->save();
 
@@ -199,7 +199,7 @@ public function doCustomContentTypeListTest() {
     // Create a test block type to decouple looking for translate
     // operations link so this does not test more than necessary.
     $block_content_type = BlockContentType::create([
-      'id' => mb_strtolower($this->randomMachineName(16)),
+      'id' => $this->randomMachineName(16),
       'label' => $this->randomMachineName(),
       'revision' => FALSE,
     ]);
@@ -224,7 +224,7 @@ public function doContactFormsListTest() {
     // Create a test contact form to decouple looking for translate operations
     // link so this does not test more than necessary.
     $contact_form = ContactForm::create([
-      'id' => mb_strtolower($this->randomMachineName(16)),
+      'id' => $this->randomMachineName(16),
       'label' => $this->randomMachineName(),
     ]);
     $contact_form->save();
@@ -248,7 +248,7 @@ public function doContentTypeListTest() {
     // Create a test content type to decouple looking for translate operations
     // link so this does not test more than necessary.
     $content_type = $this->drupalCreateContentType([
-      'type' => mb_strtolower($this->randomMachineName(16)),
+      'type' => $this->randomMachineName(16),
       'name' => $this->randomMachineName(),
     ]);
 
@@ -271,7 +271,7 @@ public function doFormatsListTest() {
     // Create a test format to decouple looking for translate operations
     // link so this does not test more than necessary.
     $filter_format = FilterFormat::create([
-      'format' => mb_strtolower($this->randomMachineName(16)),
+      'format' => $this->randomMachineName(16),
       'name' => $this->randomMachineName(),
     ]);
     $filter_format->save();
@@ -295,7 +295,7 @@ public function doShortcutListTest() {
     // Create a test shortcut to decouple looking for translate operations
     // link so this does not test more than necessary.
     $shortcut = ShortcutSet::create([
-      'id' => mb_strtolower($this->randomMachineName(16)),
+      'id' => $this->randomMachineName(16),
       'label' => $this->randomString(),
     ]);
     $shortcut->save();
@@ -318,7 +318,7 @@ public function doShortcutListTest() {
   public function doUserRoleListTest() {
     // Create a test role to decouple looking for translate operations
     // link so this does not test more than necessary.
-    $role_id = mb_strtolower($this->randomMachineName(16));
+    $role_id = $this->randomMachineName(16);
     $this->drupalCreateRole([], $role_id);
 
     // Get the role listing.
@@ -400,7 +400,7 @@ public function doResponsiveImageListTest() {
   public function doFieldListTest() {
     // Create a base content type.
     $content_type = $this->drupalCreateContentType([
-      'type' => mb_strtolower($this->randomMachineName(16)),
+      'type' => $this->randomMachineName(16),
       'name' => $this->randomMachineName(),
     ]);
 
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php
index 0371c396853d..688009de5bbe 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationUiTest.php
@@ -746,7 +746,7 @@ public function testPluralConfigStrings() {
   public function testFieldConfigTranslation() {
     // Add a test field which has a translatable field setting and a
     // translatable field storage setting.
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
@@ -757,7 +757,7 @@ public function testFieldConfigTranslation() {
     $field_storage->setSetting('translatable_storage_setting', $translatable_storage_setting);
     $field_storage->save();
 
-    $bundle = strtolower($this->randomMachineName());
+    $bundle = $this->randomMachineName();
     entity_test_create_bundle($bundle);
     $field = FieldConfig::create([
       'field_name' => $field_name,
@@ -785,14 +785,14 @@ public function testFieldConfigTranslation() {
    */
   public function testBooleanFieldConfigTranslation() {
     // Add a test boolean field.
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
       'type' => 'boolean',
     ])->save();
 
-    $bundle = strtolower($this->randomMachineName());
+    $bundle = $this->randomMachineName();
     entity_test_create_bundle($bundle);
     $field = FieldConfig::create([
       'field_name' => $field_name,
diff --git a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
index 8035f6ac4415..7f8b1090dc07 100644
--- a/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactSitewideTest.php
@@ -163,16 +163,16 @@ public function testSiteWideContact() {
     $recipients = ['simpletest&@example.com', 'simpletest2@example.com', 'simpletest3@example.com'];
     $max_length = EntityTypeInterface::BUNDLE_MAX_LENGTH;
     $max_length_exceeded = $max_length + 1;
-    $this->addContactForm($id = mb_strtolower($this->randomMachineName($max_length_exceeded)), $label = $this->randomMachineName($max_length_exceeded), implode(',', [$recipients[0]]), '', TRUE);
+    $this->addContactForm($id = $this->randomMachineName($max_length_exceeded), $label = $this->randomMachineName($max_length_exceeded), implode(',', [$recipients[0]]), '', TRUE);
     $this->assertSession()->pageTextContains('Machine-readable name cannot be longer than ' . $max_length . ' characters but is currently ' . $max_length_exceeded . ' characters long.');
-    $this->addContactForm($id = mb_strtolower($this->randomMachineName($max_length)), $label = $this->randomMachineName($max_length), implode(',', [$recipients[0]]), '', TRUE);
+    $this->addContactForm($id = $this->randomMachineName($max_length), $label = $this->randomMachineName($max_length), implode(',', [$recipients[0]]), '', TRUE);
     $this->assertSession()->pageTextContains('Contact form ' . $label . ' has been added.');
 
     // Verify that the creation message contains a link to a contact form.
     $this->assertSession()->elementExists('xpath', '//div[@data-drupal-messages]//a[contains(@href, "contact/")]');
 
     // Create first valid form.
-    $this->addContactForm($id = mb_strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', [$recipients[0]]), '', TRUE);
+    $this->addContactForm($id = $this->randomMachineName(16), $label = $this->randomMachineName(16), implode(',', [$recipients[0]]), '', TRUE);
     $this->assertSession()->pageTextContains('Contact form ' . $label . ' has been added.');
 
     // Verify that the creation message contains a link to a contact form.
@@ -214,10 +214,10 @@ public function testSiteWideContact() {
     $this->drupalLogin($admin_user);
 
     // Add more forms.
-    $this->addContactForm(mb_strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', [$recipients[0], $recipients[1]]), '', FALSE);
+    $this->addContactForm($this->randomMachineName(16), $label = $this->randomMachineName(16), implode(',', [$recipients[0], $recipients[1]]), '', FALSE);
     $this->assertSession()->pageTextContains('Contact form ' . $label . ' has been added.');
 
-    $this->addContactForm($name = mb_strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', [$recipients[0], $recipients[1], $recipients[2]]), '', FALSE);
+    $this->addContactForm($name = $this->randomMachineName(16), $label = $this->randomMachineName(16), implode(',', [$recipients[0], $recipients[1], $recipients[2]]), '', FALSE);
     $this->assertSession()->pageTextContains('Contact form ' . $label . ' has been added.');
 
     // Try adding a form that already exists.
@@ -282,7 +282,7 @@ public function testSiteWideContact() {
 
     $label = $this->randomMachineName(16);
     $recipients = implode(',', [$recipients[0], $recipients[1], $recipients[2]]);
-    $contact_form = mb_strtolower($this->randomMachineName(16));
+    $contact_form = $this->randomMachineName(16);
     $this->addContactForm($contact_form, $label, $recipients, '', FALSE);
     $this->drupalGet('admin/structure/contact');
     $this->clickLink('Edit');
@@ -314,7 +314,7 @@ public function testSiteWideContact() {
     $this->assertSession()->statusCodeEquals(200);
 
     // Create a simple textfield.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_label = $this->randomMachineName();
     $this->fieldUIAddNewField(NULL, $field_name, $field_label, 'text');
     $field_name = 'field_' . $field_name;
diff --git a/core/modules/contact/tests/src/Functional/ContactStorageTest.php b/core/modules/contact/tests/src/Functional/ContactStorageTest.php
index b84297ece50c..a0937614cdae 100644
--- a/core/modules/contact/tests/src/Functional/ContactStorageTest.php
+++ b/core/modules/contact/tests/src/Functional/ContactStorageTest.php
@@ -51,7 +51,7 @@ public function testContactStorage() {
     $this->drupalLogin($admin_user);
     // Create first valid contact form.
     $mail = 'simpletest@example.com';
-    $this->addContactForm($id = mb_strtolower($this->randomMachineName(16)), $label = $this->randomMachineName(16), implode(',', [$mail]), '', TRUE, 'Your message has been sent.', [
+    $this->addContactForm($id = $this->randomMachineName(16), $label = $this->randomMachineName(16), implode(',', [$mail]), '', TRUE, 'Your message has been sent.', [
       'send_a_pony' => 1,
     ]);
     $this->assertSession()->pageTextContains('Contact form ' . $label . ' has been added.');
diff --git a/core/modules/contact/tests/src/Kernel/Views/ContactFieldsTest.php b/core/modules/contact/tests/src/Kernel/Views/ContactFieldsTest.php
index ae83c46e87ad..5865c2eaa391 100644
--- a/core/modules/contact/tests/src/Kernel/Views/ContactFieldsTest.php
+++ b/core/modules/contact/tests/src/Kernel/Views/ContactFieldsTest.php
@@ -34,7 +34,7 @@ public function testViewsData() {
     FieldStorageConfig::create([
       'type' => 'text',
       'entity_type' => 'contact_message',
-      'field_name' => $field_name = strtolower($this->randomMachineName()),
+      'field_name' => $field_name = $this->randomMachineName(),
     ])->save();
 
     ContactForm::create([
diff --git a/core/modules/datetime/tests/src/Functional/DateTestBase.php b/core/modules/datetime/tests/src/Functional/DateTestBase.php
index 57cc4cb641e1..ba935418fa70 100644
--- a/core/modules/datetime/tests/src/Functional/DateTestBase.php
+++ b/core/modules/datetime/tests/src/Functional/DateTestBase.php
@@ -114,8 +114,8 @@ protected function setUp(): void {
    * Creates a date test field.
    */
   protected function createField() {
-    $field_name = mb_strtolower($this->randomMachineName());
-    $field_label = Unicode::ucfirst(mb_strtolower($this->randomMachineName()));
+    $field_name = $this->randomMachineName();
+    $field_label = Unicode::ucfirst($this->randomMachineName());
     $type = $this->getTestFieldType();
     $widget_type = $formatter_type = $type . '_default';
 
diff --git a/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php b/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php
index 797cdc6803fd..67d8c328da62 100644
--- a/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php
+++ b/core/modules/datetime/tests/src/Functional/DateTimeFieldTest.php
@@ -688,7 +688,7 @@ public function testDefaultValue() {
     $this->drupalCreateContentType(['type' => 'date_content']);
 
     // Create a field storage with settings to validate.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'node',
@@ -905,7 +905,7 @@ public function testDateStorageSettings() {
     $this->drupalCreateContentType(['type' => 'date_content']);
 
     // Create a field storage with settings to validate.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'node',
diff --git a/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php b/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php
index 7d477be4fce4..f19d18fd1b1e 100644
--- a/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php
+++ b/core/modules/datetime_range/tests/src/Functional/DateRangeFieldTest.php
@@ -1000,7 +1000,7 @@ public function testDefaultValue() {
     $this->drupalCreateContentType(['type' => 'date_content']);
 
     // Create a field storage with settings to validate.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'node',
@@ -1391,7 +1391,7 @@ public function testDateStorageSettings() {
     $this->drupalCreateContentType(['type' => 'date_content']);
 
     // Create a field storage with settings to validate.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'node',
diff --git a/core/modules/datetime_range/tests/src/Kernel/DateRangeItemTest.php b/core/modules/datetime_range/tests/src/Kernel/DateRangeItemTest.php
index 9620f5cf8dce..ef8e75fb4663 100644
--- a/core/modules/datetime_range/tests/src/Kernel/DateRangeItemTest.php
+++ b/core/modules/datetime_range/tests/src/Kernel/DateRangeItemTest.php
@@ -46,7 +46,7 @@ protected function setUp(): void {
 
     // Add a datetime range field.
     $this->fieldStorage = FieldStorageConfig::create([
-      'field_name' => mb_strtolower($this->randomMachineName()),
+      'field_name' => $this->randomMachineName(),
       'entity_type' => 'entity_test',
       'type' => 'daterange',
       'settings' => ['datetime_type' => DateRangeItem::DATETIME_TYPE_DATE],
diff --git a/core/modules/datetime_range/tests/src/Kernel/SeparatorTranslationTest.php b/core/modules/datetime_range/tests/src/Kernel/SeparatorTranslationTest.php
index 74e4fc6301ba..beb7a5540b11 100644
--- a/core/modules/datetime_range/tests/src/Kernel/SeparatorTranslationTest.php
+++ b/core/modules/datetime_range/tests/src/Kernel/SeparatorTranslationTest.php
@@ -57,7 +57,7 @@ protected function setUp(): void {
 
     // Add a datetime range field.
     $this->fieldStorage = FieldStorageConfig::create([
-      'field_name' => mb_strtolower($this->randomMachineName()),
+      'field_name' => $this->randomMachineName(),
       'entity_type' => 'entity_test',
       'type' => 'daterange',
       'settings' => ['datetime_type' => DateTimeItem::DATETIME_TYPE_DATE],
diff --git a/core/modules/editor/tests/src/Functional/EditorAdminTest.php b/core/modules/editor/tests/src/Functional/EditorAdminTest.php
index 4323d50139ab..985bc4a9be81 100644
--- a/core/modules/editor/tests/src/Functional/EditorAdminTest.php
+++ b/core/modules/editor/tests/src/Functional/EditorAdminTest.php
@@ -116,7 +116,7 @@ public function testDisableFormatWithEditor() {
     $this->container->get('module_installer')->install(['node']);
     $this->resetAll();
     // Create a new node type and attach the 'body' field to it.
-    $node_type = NodeType::create(['type' => mb_strtolower($this->randomMachineName()), 'name' => $this->randomString()]);
+    $node_type = NodeType::create(['type' => $this->randomMachineName(), 'name' => $this->randomString()]);
     $node_type->save();
     node_add_body_field($node_type, $this->randomString());
 
diff --git a/core/modules/editor/tests/src/Kernel/EditorFilterIntegrationTest.php b/core/modules/editor/tests/src/Kernel/EditorFilterIntegrationTest.php
index 66c238e73ea1..8d4705eea199 100644
--- a/core/modules/editor/tests/src/Kernel/EditorFilterIntegrationTest.php
+++ b/core/modules/editor/tests/src/Kernel/EditorFilterIntegrationTest.php
@@ -24,7 +24,7 @@ class EditorFilterIntegrationTest extends KernelTestBase {
   public function testTextFormatIntegration() {
     // Create an arbitrary text format.
     $format = FilterFormat::create([
-      'format' => mb_strtolower($this->randomMachineName()),
+      'format' => $this->randomMachineName(),
       'name' => $this->randomString(),
     ]);
     $format->save();
diff --git a/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php b/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php
index 5e7ba126efcf..e200b90b2304 100644
--- a/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php
+++ b/core/modules/field/tests/src/Functional/Boolean/BooleanFieldTest.php
@@ -68,7 +68,7 @@ public function testBooleanField() {
     $label = $this->randomMachineName();
 
     // Create a field with settings to validate.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->fieldStorage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
diff --git a/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php b/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php
index 5e7a3aaced55..1834993ce60f 100644
--- a/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php
+++ b/core/modules/field/tests/src/Functional/Boolean/BooleanFormatterSettingsTest.php
@@ -46,7 +46,7 @@ protected function setUp(): void {
     parent::setUp();
 
     // Create a content type. Use Node because it has Field UI pages that work.
-    $type_name = mb_strtolower($this->randomMachineName(8)) . '_test';
+    $type_name = $this->randomMachineName(8) . '_test';
     $type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
     $this->bundle = $type->id();
 
@@ -60,7 +60,7 @@ protected function setUp(): void {
     ]);
     $this->drupalLogin($admin_user);
 
-    $this->fieldName = mb_strtolower($this->randomMachineName(8));
+    $this->fieldName = $this->randomMachineName(8);
 
     $field_storage = FieldStorageConfig::create([
       'field_name' => $this->fieldName,
diff --git a/core/modules/field/tests/src/Functional/Email/EmailFieldTest.php b/core/modules/field/tests/src/Functional/Email/EmailFieldTest.php
index 6171e08f100d..1bcd8aa65c98 100644
--- a/core/modules/field/tests/src/Functional/Email/EmailFieldTest.php
+++ b/core/modules/field/tests/src/Functional/Email/EmailFieldTest.php
@@ -58,7 +58,7 @@ protected function setUp(): void {
    */
   public function testEmailField() {
     // Create a field with settings to validate.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->fieldStorage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php
index 5c2d299fcfae..3be9c473a41b 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAdminTest.php
@@ -57,7 +57,7 @@ protected function setUp(): void {
     $this->drupalPlaceBlock('system_breadcrumb_block');
 
     // Create a content type, with underscores.
-    $type_name = strtolower($this->randomMachineName(8)) . '_test';
+    $type_name = $this->randomMachineName(8) . '_test';
     $type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
     $this->type = $type->id();
 
@@ -303,7 +303,7 @@ public function testMultipleTargetBundles() {
     /** @var \Drupal\taxonomy\Entity\Vocabulary[] $vocabularies */
     $vocabularies = [];
     for ($i = 0; $i < 2; $i++) {
-      $vid = mb_strtolower($this->randomMachineName());
+      $vid = $this->randomMachineName();
       $vocabularies[$i] = Vocabulary::create([
         'name' => $this->randomString(),
         'vid' => $vid,
@@ -374,7 +374,7 @@ protected function createEntityReferenceField($target_type, $bundles = []) {
     $bundle_path = 'admin/structure/types/manage/' . $this->type;
 
     // Generate a random field name, must be only lowercase characters.
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
 
     $storage_edit = $field_edit = [];
     $storage_edit['settings[target_type]'] = $target_type;
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
index 894cf63fe9e8..991214a4bb0e 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceAutoCreateTest.php
@@ -162,7 +162,7 @@ public function testMultipleTargetBundles() {
     /** @var \Drupal\taxonomy\Entity\Vocabulary[] $vocabularies */
     $vocabularies = [];
     for ($i = 0; $i < 2; $i++) {
-      $vid = mb_strtolower($this->randomMachineName());
+      $vid = $this->randomMachineName();
       $vocabularies[$i] = Vocabulary::create([
         'name' => $this->randomMachineName(),
         'vid' => $vid,
@@ -173,7 +173,7 @@ public function testMultipleTargetBundles() {
     // Create a taxonomy term entity reference field that saves the auto-created
     // taxonomy terms in the second vocabulary from the two that were configured
     // as targets.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $handler_settings = [
       'target_bundles' => [
         $vocabularies[0]->id() => $vocabularies[0]->id(),
@@ -261,7 +261,7 @@ public function testNoBundles() {
     ]);
     $this->drupalLogin($account);
 
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $handler_settings = [
       'auto_create' => TRUE,
     ];
diff --git a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php
index f0c55c80ab91..8a94bc7ce395 100644
--- a/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php
+++ b/core/modules/field/tests/src/Functional/EntityReference/EntityReferenceFieldDefaultValueTest.php
@@ -64,7 +64,7 @@ public function testEntityReferenceDefaultValue() {
     // Create a node to be referenced.
     $referenced_node = $this->drupalCreateNode(['type' => 'referenced_content']);
 
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'node',
@@ -129,7 +129,7 @@ public function testEntityReferenceDefaultConfigValue() {
     $referenced_node_type = $this->drupalCreateContentType(['type' => 'referenced_config_to_delete']);
     $referenced_node_type2 = $this->drupalCreateContentType(['type' => 'referenced_config_to_preserve']);
 
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'node',
diff --git a/core/modules/field/tests/src/Functional/FunctionalString/StringFieldTest.php b/core/modules/field/tests/src/Functional/FunctionalString/StringFieldTest.php
index f7f9f0f9af70..ac025d78f661 100644
--- a/core/modules/field/tests/src/Functional/FunctionalString/StringFieldTest.php
+++ b/core/modules/field/tests/src/Functional/FunctionalString/StringFieldTest.php
@@ -63,7 +63,7 @@ public function testTextfieldWidgets() {
    */
   public function _testTextfieldWidgets($field_type, $widget_type) {
     // Create a field.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
diff --git a/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php b/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php
index a7fb5a427138..f5317dcc8539 100644
--- a/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php
+++ b/core/modules/field/tests/src/Functional/Number/NumberFieldTest.php
@@ -47,7 +47,7 @@ protected function setUp(): void {
    */
   public function testNumberDecimalField() {
     // Create a field with settings to validate.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
@@ -138,7 +138,7 @@ public function testNumberIntegerField() {
     $maximum = rand(2000, 4000);
 
     // Create a field with settings to validate.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
@@ -290,7 +290,7 @@ public function testNumberIntegerField() {
    */
   public function testNumberFloatField() {
     // Create a field with settings to validate.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
@@ -383,7 +383,7 @@ public function testNumberFloatField() {
    */
   public function testCreateNumberFloatField() {
     // Create a float field.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
@@ -408,7 +408,7 @@ public function testCreateNumberFloatField() {
    */
   public function testCreateNumberDecimalField() {
     // Create a decimal field.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
diff --git a/core/modules/field/tests/src/Functional/TranslationWebTest.php b/core/modules/field/tests/src/Functional/TranslationWebTest.php
index aeee7c512750..54b1faf9d46a 100644
--- a/core/modules/field/tests/src/Functional/TranslationWebTest.php
+++ b/core/modules/field/tests/src/Functional/TranslationWebTest.php
@@ -60,7 +60,7 @@ class TranslationWebTest extends FieldTestBase {
   protected function setUp(): void {
     parent::setUp();
 
-    $this->fieldName = mb_strtolower($this->randomMachineName() . '_field_name');
+    $this->fieldName = $this->randomMachineName() . '_field_name';
 
     $field_storage = [
       'field_name' => $this->fieldName,
diff --git a/core/modules/field/tests/src/FunctionalJavascript/Boolean/BooleanFormatterSettingsTest.php b/core/modules/field/tests/src/FunctionalJavascript/Boolean/BooleanFormatterSettingsTest.php
index 583852beccdf..c7ebc597a6e1 100644
--- a/core/modules/field/tests/src/FunctionalJavascript/Boolean/BooleanFormatterSettingsTest.php
+++ b/core/modules/field/tests/src/FunctionalJavascript/Boolean/BooleanFormatterSettingsTest.php
@@ -46,7 +46,7 @@ protected function setUp(): void {
     parent::setUp();
 
     // Create a content type. Use Node because it has Field UI pages that work.
-    $type_name = mb_strtolower($this->randomMachineName(8)) . '_test';
+    $type_name = $this->randomMachineName(8) . '_test';
     $type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
     $this->bundle = $type->id();
 
@@ -60,7 +60,7 @@ protected function setUp(): void {
     ]);
     $this->drupalLogin($admin_user);
 
-    $this->fieldName = mb_strtolower($this->randomMachineName(8));
+    $this->fieldName = $this->randomMachineName(8);
 
     $field_storage = FieldStorageConfig::create([
       'field_name' => $this->fieldName,
diff --git a/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php b/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php
index 6b32c4eedc02..5e0fb206b50e 100644
--- a/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php
+++ b/core/modules/field/tests/src/FunctionalJavascript/EntityReference/EntityReferenceAdminTest.php
@@ -65,12 +65,12 @@ protected function setUp(): void {
     $this->drupalPlaceBlock('system_breadcrumb_block');
 
     // Create a content type, with underscores.
-    $type_name = strtolower($this->randomMachineName(8)) . '_test';
+    $type_name = $this->randomMachineName(8) . '_test';
     $type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
     $this->type = $type->id();
 
     // Create a second content type, to be a target for entity reference fields.
-    $type_name = strtolower($this->randomMachineName(8)) . '_test';
+    $type_name = $this->randomMachineName(8) . '_test';
     $type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
     $this->targetType = $type->id();
 
diff --git a/core/modules/field/tests/src/FunctionalJavascript/Number/NumberFieldTest.php b/core/modules/field/tests/src/FunctionalJavascript/Number/NumberFieldTest.php
index 523677945178..e06acc1b1408 100644
--- a/core/modules/field/tests/src/FunctionalJavascript/Number/NumberFieldTest.php
+++ b/core/modules/field/tests/src/FunctionalJavascript/Number/NumberFieldTest.php
@@ -45,9 +45,9 @@ protected function setUp(): void {
    * Tests default formatter behavior.
    */
   public function testNumberFormatter() {
-    $type = mb_strtolower($this->randomMachineName());
-    $float_field = mb_strtolower($this->randomMachineName());
-    $integer_field = mb_strtolower($this->randomMachineName());
+    $type = $this->randomMachineName();
+    $float_field = $this->randomMachineName();
+    $integer_field = $this->randomMachineName();
     $thousand_separators = ['', '.', ',', ' ', chr(8201), "'"];
     $decimal_separators = ['.', ','];
     $prefix = $this->randomMachineName();
diff --git a/core/modules/field/tests/src/Kernel/Boolean/BooleanFormatterTest.php b/core/modules/field/tests/src/Kernel/Boolean/BooleanFormatterTest.php
index acebe47fdaa0..06e22f6a8321 100644
--- a/core/modules/field/tests/src/Kernel/Boolean/BooleanFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/Boolean/BooleanFormatterTest.php
@@ -60,7 +60,7 @@ protected function setUp(): void {
 
     $this->entityType = 'entity_test';
     $this->bundle = $this->entityType;
-    $this->fieldName = mb_strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
 
     $field_storage = FieldStorageConfig::create([
       'field_name' => $this->fieldName,
diff --git a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php
index 10fda5adc584..cb59668fae38 100644
--- a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php
+++ b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceItemTest.php
@@ -88,7 +88,7 @@ protected function setUp(): void {
 
     $this->vocabulary = Vocabulary::create([
       'name' => $this->randomMachineName(),
-      'vid' => mb_strtolower($this->randomMachineName()),
+      'vid' => $this->randomMachineName(),
       'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
     ]);
     $this->vocabulary->save();
@@ -291,7 +291,7 @@ public function testConfigEntityReferenceItem() {
     // Make sure the computed term reflects updates to the term id.
     $vocabulary2 = $vocabulary = Vocabulary::create([
       'name' => $this->randomMachineName(),
-      'vid' => mb_strtolower($this->randomMachineName()),
+      'vid' => $this->randomMachineName(),
       'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
     ]);
     $vocabulary2->save();
@@ -362,7 +362,7 @@ public function testEntitySaveOrder() {
    * Tests that the 'handler' field setting stores the proper plugin ID.
    */
   public function testSelectionHandlerSettings() {
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
diff --git a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php
index 92b4fa1da293..7a5301c4aff2 100644
--- a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php
+++ b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php
@@ -72,13 +72,13 @@ protected function setUp(): void {
     $this->installEntitySchema('entity_test');
 
     $this->nodeType = NodeType::create([
-      'type' => mb_strtolower($this->randomMachineName()),
+      'type' => $this->randomMachineName(),
       'name' => $this->randomString(),
     ]);
     $this->nodeType->save();
 
     // Create a custom bundle.
-    $this->customBundle = 'test_bundle_' . mb_strtolower($this->randomMachineName());
+    $this->customBundle = 'test_bundle_' . $this->randomMachineName();
     entity_test_create_bundle($this->customBundle, NULL, 'entity_test');
 
     // Prepare the logger for collecting the expected critical error.
@@ -93,7 +93,7 @@ public function testConfigTargetBundleDeletion() {
     /** @var \Drupal\taxonomy\Entity\Vocabulary[] $vocabularies */
     $vocabularies = [];
     for ($i = 0; $i < 2; $i++) {
-      $vid = mb_strtolower($this->randomMachineName());
+      $vid = $this->randomMachineName();
       $vocabularies[$i] = Vocabulary::create([
         'name' => $this->randomString(),
         'vid' => $vid,
@@ -101,7 +101,7 @@ public function testConfigTargetBundleDeletion() {
       $vocabularies[$i]->save();
     }
     // Attach an entity reference field to $this->nodeType.
-    $name = mb_strtolower($this->randomMachineName());
+    $name = $this->randomMachineName();
     $label = $this->randomString();
     $handler_settings = [
       'target_bundles' => [
@@ -150,7 +150,7 @@ public function testConfigTargetBundleDeletion() {
    */
   public function testCustomTargetBundleDeletion() {
     // Attach an entity reference field to $this->nodeType.
-    $name = mb_strtolower($this->randomMachineName());
+    $name = $this->randomMachineName();
     $label = $this->randomString();
     $handler_settings = ['target_bundles' => [$this->customBundle => $this->customBundle]];
     $this->createEntityReferenceField('node', $this->nodeType->id(), $name, $label, 'entity_test', 'default', $handler_settings);
diff --git a/core/modules/field/tests/src/Kernel/EntityReference/Views/SelectionTest.php b/core/modules/field/tests/src/Kernel/EntityReference/Views/SelectionTest.php
index 505eca676b59..c0cf2c69d9f3 100644
--- a/core/modules/field/tests/src/Kernel/EntityReference/Views/SelectionTest.php
+++ b/core/modules/field/tests/src/Kernel/EntityReference/Views/SelectionTest.php
@@ -60,7 +60,7 @@ protected function setUp(): void {
     $this->installEntitySchema('node');
 
     // Create test nodes.
-    $type = strtolower($this->randomMachineName());
+    $type = $this->randomMachineName();
     NodeType::create(['type' => $type])->save();
     $node1 = $this->createNode(['type' => $type]);
     $node2 = $this->createNode(['type' => $type]);
diff --git a/core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php b/core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php
index 117b80cc7d18..751ec5cd5a0e 100644
--- a/core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldAttachStorageTest.php
@@ -294,7 +294,7 @@ public function testEntityCreateBundle() {
     $cardinality = $this->fieldTestData->field_storage->getCardinality();
 
     // Create a new bundle.
-    $new_bundle = 'test_bundle_' . mb_strtolower($this->randomMachineName());
+    $new_bundle = 'test_bundle_' . $this->randomMachineName();
     entity_test_create_bundle($new_bundle, NULL, $entity_type);
 
     // Add a field to that bundle.
@@ -321,7 +321,7 @@ public function testEntityDeleteBundle() {
     $this->createFieldWithStorage('', $entity_type);
 
     // Create a new bundle.
-    $new_bundle = 'test_bundle_' . mb_strtolower($this->randomMachineName());
+    $new_bundle = 'test_bundle_' . $this->randomMachineName();
     entity_test_create_bundle($new_bundle, NULL, $entity_type);
 
     // Add a field to that bundle.
@@ -329,7 +329,7 @@ public function testEntityDeleteBundle() {
     FieldConfig::create($this->fieldTestData->field_definition)->save();
 
     // Create a second field for the test bundle
-    $field_name = mb_strtolower($this->randomMachineName() . '_field_name');
+    $field_name = $this->randomMachineName() . '_field_name';
     $field_storage = [
       'field_name' => $field_name,
       'entity_type' => $entity_type,
diff --git a/core/modules/field/tests/src/Kernel/FieldCrudTest.php b/core/modules/field/tests/src/Kernel/FieldCrudTest.php
index 0742f856f8c1..66087c97076c 100644
--- a/core/modules/field/tests/src/Kernel/FieldCrudTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldCrudTest.php
@@ -45,7 +45,7 @@ protected function setUp(): void {
     parent::setUp();
 
     $this->fieldStorageDefinition = [
-      'field_name' => mb_strtolower($this->randomMachineName()),
+      'field_name' => $this->randomMachineName(),
       'entity_type' => 'entity_test',
       'type' => 'test_field',
     ];
@@ -201,7 +201,7 @@ protected function doFieldPropertyConstraintsTests() {
    * Tests creating a field with custom storage set.
    */
   public function testCreateFieldCustomStorage() {
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     \Drupal::state()->set('field_test_custom_storage', $field_name);
 
     $field_storage = FieldStorageConfig::create([
diff --git a/core/modules/field/tests/src/Kernel/FieldDisplayTest.php b/core/modules/field/tests/src/Kernel/FieldDisplayTest.php
index 3d81d09d5654..09801aea26b2 100644
--- a/core/modules/field/tests/src/Kernel/FieldDisplayTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldDisplayTest.php
@@ -67,7 +67,7 @@ protected function setUp(): void {
 
     $this->entityType = 'entity_test_rev';
     $this->bundle = $this->entityType;
-    $this->fieldName = mb_strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
 
     $field_storage = FieldStorageConfig::create([
       'field_name' => $this->fieldName,
diff --git a/core/modules/field/tests/src/Kernel/FieldFormatterTest.php b/core/modules/field/tests/src/Kernel/FieldFormatterTest.php
index d02f238daad4..130233c9d747 100644
--- a/core/modules/field/tests/src/Kernel/FieldFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldFormatterTest.php
@@ -54,7 +54,7 @@ protected function setUp(): void {
 
     $entity_type = 'entity_test_rev';
     $bundle = $entity_type;
-    $this->fieldName = mb_strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
 
     $field_storage = FieldStorageConfig::create([
       'field_name' => $this->fieldName,
diff --git a/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php b/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php
index 5200f8e0152e..a6dd4bae1cf5 100644
--- a/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php
+++ b/core/modules/field/tests/src/Kernel/FieldKernelTestBase.php
@@ -98,7 +98,7 @@ protected function createFieldWithStorage($suffix = '', $entity_type = 'entity_t
     $field = 'field' . $suffix;
     $field_definition = 'field_definition' . $suffix;
 
-    $this->fieldTestData->$field_name = mb_strtolower($this->randomMachineName() . '_field_name' . $suffix);
+    $this->fieldTestData->$field_name = $this->randomMachineName() . '_field_name' . $suffix;
     $this->fieldTestData->$field_storage = FieldStorageConfig::create([
       'field_name' => $this->fieldTestData->$field_name,
       'entity_type' => $entity_type,
diff --git a/core/modules/field/tests/src/Kernel/KernelString/RawStringFormatterTest.php b/core/modules/field/tests/src/Kernel/KernelString/RawStringFormatterTest.php
index 7bdaba595647..ca57b071bd43 100644
--- a/core/modules/field/tests/src/Kernel/KernelString/RawStringFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/KernelString/RawStringFormatterTest.php
@@ -62,7 +62,7 @@ protected function setUp(): void {
 
     $this->entityType = 'entity_test';
     $this->bundle = $this->entityType;
-    $this->fieldName = mb_strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
 
     $field_storage = FieldStorageConfig::create([
       'field_name' => $this->fieldName,
diff --git a/core/modules/field/tests/src/Kernel/KernelString/StringFormatterTest.php b/core/modules/field/tests/src/Kernel/KernelString/StringFormatterTest.php
index 94878dbd1275..36551fb4acb2 100644
--- a/core/modules/field/tests/src/Kernel/KernelString/StringFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/KernelString/StringFormatterTest.php
@@ -72,7 +72,7 @@ protected function setUp(): void {
 
     $this->entityType = 'entity_test_rev';
     $this->bundle = $this->entityType;
-    $this->fieldName = mb_strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
 
     $field_storage = FieldStorageConfig::create([
       'field_name' => $this->fieldName,
diff --git a/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php b/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php
index 2e5e7349aafb..d846586b4f22 100644
--- a/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/Timestamp/TimestampFormatterTest.php
@@ -60,7 +60,7 @@ protected function setUp(): void {
 
     $this->entityType = 'entity_test';
     $this->bundle = $this->entityType;
-    $this->fieldName = mb_strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
 
     $field_storage = FieldStorageConfig::create([
       'field_name' => $this->fieldName,
diff --git a/core/modules/field/tests/src/Kernel/TranslationTest.php b/core/modules/field/tests/src/Kernel/TranslationTest.php
index 0cd0c0946c8f..8e9dc31bb280 100644
--- a/core/modules/field/tests/src/Kernel/TranslationTest.php
+++ b/core/modules/field/tests/src/Kernel/TranslationTest.php
@@ -76,7 +76,7 @@ protected function setUp(): void {
     $this->installEntitySchema('node');
     $this->installConfig(['language']);
 
-    $this->fieldName = mb_strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
 
     $this->entityType = 'entity_test';
 
@@ -141,7 +141,7 @@ public function testTranslatableFieldSaveLoad() {
     }
 
     // Test default values.
-    $field_name_default = mb_strtolower($this->randomMachineName() . '_field_name');
+    $field_name_default = $this->randomMachineName() . '_field_name';
     $field_storage_definition = $this->fieldStorageDefinition;
     $field_storage_definition['field_name'] = $field_name_default;
     $field_storage = FieldStorageConfig::create($field_storage_definition);
diff --git a/core/modules/field/tests/src/Kernel/Uri/UriItemTest.php b/core/modules/field/tests/src/Kernel/Uri/UriItemTest.php
index 1ea0db728dc8..f0defeedcd52 100644
--- a/core/modules/field/tests/src/Kernel/Uri/UriItemTest.php
+++ b/core/modules/field/tests/src/Kernel/Uri/UriItemTest.php
@@ -37,7 +37,7 @@ public function testUriField() {
     $label = $this->randomMachineName();
 
     // Create a field with settings to validate.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->fieldStorage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
diff --git a/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php b/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php
index fea239374b6f..5343cc444c73 100644
--- a/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php
+++ b/core/modules/field_ui/tests/src/Functional/EntityDisplayModeTest.php
@@ -65,7 +65,7 @@ public function testEntityViewModeUI() {
     // Test adding a view mode including dots in machine_name.
     $this->clickLink('Test entity');
     $edit = [
-      'id' => strtolower($this->randomMachineName()) . '.' . strtolower($this->randomMachineName()),
+      'id' => $this->randomMachineName() . '.' . $this->randomMachineName(),
       'label' => $this->randomString(),
     ];
     $this->submitForm($edit, 'Save');
@@ -73,7 +73,7 @@ public function testEntityViewModeUI() {
 
     // Test adding a view mode.
     $edit = [
-      'id' => strtolower($this->randomMachineName()),
+      'id' => $this->randomMachineName(),
       'label' => $this->randomString(),
     ];
     $this->submitForm($edit, 'Save');
@@ -119,7 +119,7 @@ public function testEntityFormModeUI() {
     // Test adding a view mode including dots in machine_name.
     $this->clickLink('Test entity');
     $edit = [
-      'id' => strtolower($this->randomMachineName()) . '.' . strtolower($this->randomMachineName()),
+      'id' => $this->randomMachineName() . '.' . $this->randomMachineName(),
       'label' => $this->randomString(),
     ];
     $this->submitForm($edit, 'Save');
@@ -127,7 +127,7 @@ public function testEntityFormModeUI() {
 
     // Test adding a form mode.
     $edit = [
-      'id' => strtolower($this->randomMachineName()),
+      'id' => $this->randomMachineName(),
       'label' => $this->randomString(),
     ];
     $this->submitForm($edit, 'Save');
diff --git a/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php b/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php
index b83dd5a025bf..b0631dde7eeb 100644
--- a/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php
+++ b/core/modules/field_ui/tests/src/Functional/FieldUIDeleteTest.php
@@ -78,7 +78,7 @@ public function testDeleteField() {
     $field_name = 'field_test';
 
     // Create an additional node type.
-    $type_name1 = strtolower($this->randomMachineName(8)) . '_test';
+    $type_name1 = $this->randomMachineName(8) . '_test';
     $type1 = $this->drupalCreateContentType(['name' => $type_name1, 'type' => $type_name1]);
     $type_name1 = $type1->id();
 
@@ -87,7 +87,7 @@ public function testDeleteField() {
     $this->fieldUIAddNewField($bundle_path1, $field_name_input, $field_label);
 
     // Create an additional node type.
-    $type_name2 = strtolower($this->randomMachineName(8)) . '_test';
+    $type_name2 = $this->randomMachineName(8) . '_test';
     $type2 = $this->drupalCreateContentType(['name' => $type_name2, 'type' => $type_name2]);
     $type_name2 = $type2->id();
 
diff --git a/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php b/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
index d1af28fc86cd..254704993e40 100644
--- a/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
+++ b/core/modules/field_ui/tests/src/Functional/ManageDisplayTest.php
@@ -79,7 +79,7 @@ protected function setUp(): void {
     $this->drupalLogin($admin_user);
 
     // Create content type, with underscores.
-    $type_name = strtolower($this->randomMachineName(8)) . '_test';
+    $type_name = $this->randomMachineName(8) . '_test';
     $type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
     $this->type = $type->id();
 
@@ -87,7 +87,7 @@ protected function setUp(): void {
     $vocabulary = Vocabulary::create([
       'name' => $this->randomMachineName(),
       'description' => $this->randomMachineName(),
-      'vid' => mb_strtolower($this->randomMachineName()),
+      'vid' => $this->randomMachineName(),
       'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
       'help' => '',
       'nodes' => ['article' => 'article'],
diff --git a/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
index c1fc660c4003..349aa8a69184 100644
--- a/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
+++ b/core/modules/field_ui/tests/src/Functional/ManageFieldsFunctionalTest.php
@@ -104,13 +104,13 @@ protected function setUp(): void {
     $this->drupalLogin($admin_user);
 
     // Create content type, with underscores.
-    $type_name = strtolower($this->randomMachineName(8)) . '_test';
+    $type_name = $this->randomMachineName(8) . '_test';
     $type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
     $this->contentType = $type->id();
 
     // Create random field name with markup to test escaping.
     $this->fieldLabel = '<em>' . $this->randomMachineName(8) . '</em>';
-    $this->fieldNameInput = strtolower($this->randomMachineName(8));
+    $this->fieldNameInput = $this->randomMachineName(8);
     $this->fieldName = 'field_' . $this->fieldNameInput;
 
     // Create Basic page and Article node types.
@@ -477,7 +477,7 @@ public function assertFieldSettings(string $bundle, string $field_name, string $
    */
   public function testFieldPrefix() {
     // Change default field prefix.
-    $field_prefix = strtolower($this->randomMachineName(10));
+    $field_prefix = $this->randomMachineName(10);
     $this->config('field_ui.settings')->set('field_prefix', $field_prefix)->save();
 
     // Create a field input and label exceeding the new maxlength, which is 22.
@@ -600,7 +600,7 @@ public function testDeleteField() {
     $this->fieldUIAddNewField($bundle_path1, $this->fieldNameInput, $this->fieldLabel);
 
     // Create an additional node type.
-    $type_name2 = strtolower($this->randomMachineName(8)) . '_test';
+    $type_name2 = $this->randomMachineName(8) . '_test';
     $type2 = $this->drupalCreateContentType(['name' => $type_name2, 'type' => $type_name2]);
     $type_name2 = $type2->id();
 
@@ -659,7 +659,7 @@ public function testDisallowedFieldNames() {
   public function testLockedField() {
     // Create a locked field and attach it to a bundle. We need to do this
     // programmatically as there's no way to create a locked field through UI.
-    $field_name = strtolower($this->randomMachineName(8));
+    $field_name = $this->randomMachineName(8);
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'node',
diff --git a/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php b/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php
index 59e70d11d5eb..e782b5255a12 100644
--- a/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php
+++ b/core/modules/field_ui/tests/src/FunctionalJavascript/ManageDisplayTest.php
@@ -71,7 +71,7 @@ protected function setUp(): void {
     $this->drupalLogin($admin_user);
 
     // Create content type, with underscores.
-    $type_name = strtolower($this->randomMachineName(8)) . '_test';
+    $type_name = $this->randomMachineName(8) . '_test';
     $type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
     $this->type = $type->id();
 
diff --git a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
index 8610bab794de..bce2bafccbc4 100644
--- a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
+++ b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
@@ -533,14 +533,14 @@ public function testComponentDependencies() {
     // Create two arbitrary user roles.
     for ($i = 0; $i < 2; $i++) {
       $roles[$i] = Role::create([
-        'id' => mb_strtolower($this->randomMachineName()),
+        'id' => $this->randomMachineName(),
         'label' => $this->randomString(),
       ]);
       $roles[$i]->save();
     }
 
     // Create a field of type 'test_field' attached to 'entity_test'.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
diff --git a/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php b/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php
index 43dfa4fc2384..52d46385b93e 100644
--- a/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldDisplayTest.php
@@ -25,7 +25,7 @@ class FileFieldDisplayTest extends FileFieldTestBase {
    * Tests normal formatter display on node display.
    */
   public function testNodeDisplay() {
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $type_name = 'article';
     $field_storage_settings = [
       'display_field' => '1',
@@ -131,7 +131,7 @@ public function testNodeDisplay() {
    * Tests default display of File Field.
    */
   public function testDefaultFileFieldDisplay() {
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $type_name = 'article';
     $field_storage_settings = [
       'display_field' => '1',
@@ -160,7 +160,7 @@ public function testDefaultFileFieldDisplay() {
   public function testDescToggle() {
     $type_name = 'test';
     $field_type = 'file';
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     // Use the UI to add a new content type that also contains a file field.
     $edit = [
       'name' => $type_name,
@@ -190,7 +190,7 @@ public function testDescToggle() {
    * Tests description display of File Field.
    */
   public function testDescriptionDefaultFileFieldDisplay() {
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $type_name = 'article';
     $field_storage_settings = [
       'display_field' => '1',
diff --git a/core/modules/file/tests/src/Functional/FileFieldFormatterAccessTest.php b/core/modules/file/tests/src/Functional/FileFieldFormatterAccessTest.php
index 0e8100c15454..95deedc0355a 100644
--- a/core/modules/file/tests/src/Functional/FileFieldFormatterAccessTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldFormatterAccessTest.php
@@ -25,7 +25,7 @@ class FileFieldFormatterAccessTest extends FileFieldTestBase {
    */
   public function testFileAccessHandler() {
     $type_name = 'article';
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createFileField($field_name, 'node', $type_name);
     \Drupal::state()->set('file_test_alternate_access_handler', TRUE);
     \Drupal::entityTypeManager()->clearCachedDefinitions();
diff --git a/core/modules/file/tests/src/Functional/FileFieldPathTest.php b/core/modules/file/tests/src/Functional/FileFieldPathTest.php
index 4a139ab7da51..084e492b2dfa 100644
--- a/core/modules/file/tests/src/Functional/FileFieldPathTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldPathTest.php
@@ -23,7 +23,7 @@ class FileFieldPathTest extends FileFieldTestBase {
   public function testUploadPath() {
     /** @var \Drupal\node\NodeStorageInterface $node_storage */
     $node_storage = $this->container->get('entity_type.manager')->getStorage('node');
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $type_name = 'article';
     $this->createFileField($field_name, 'node', $type_name);
     /** @var \Drupal\file\FileInterface $test_file */
diff --git a/core/modules/file/tests/src/Functional/FileFieldRSSContentTest.php b/core/modules/file/tests/src/Functional/FileFieldRSSContentTest.php
index fced38d132a2..5473fcac398e 100644
--- a/core/modules/file/tests/src/Functional/FileFieldRSSContentTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldRSSContentTest.php
@@ -28,7 +28,7 @@ class FileFieldRSSContentTest extends FileFieldTestBase {
    */
   public function testFileFieldRSSContent() {
     $node_storage = $this->container->get('entity_type.manager')->getStorage('node');
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $type_name = 'article';
 
     $this->createFileField($field_name, 'node', $type_name);
diff --git a/core/modules/file/tests/src/Functional/FileFieldRevisionTest.php b/core/modules/file/tests/src/Functional/FileFieldRevisionTest.php
index 641093dc7add..1b472927b79d 100644
--- a/core/modules/file/tests/src/Functional/FileFieldRevisionTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldRevisionTest.php
@@ -36,7 +36,7 @@ public function testRevisions() {
       ->save();
     $node_storage = $this->container->get('entity_type.manager')->getStorage('node');
     $type_name = 'article';
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createFileField($field_name, 'node', $type_name);
     // Create the same fields for users.
     $this->createFileField($field_name, 'user', 'user');
diff --git a/core/modules/file/tests/src/Functional/FileFieldValidateTest.php b/core/modules/file/tests/src/Functional/FileFieldValidateTest.php
index 292d24abc07c..4cc0aaf88539 100644
--- a/core/modules/file/tests/src/Functional/FileFieldValidateTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldValidateTest.php
@@ -28,7 +28,7 @@ class FileFieldValidateTest extends FileFieldTestBase {
   public function testRequired() {
     $node_storage = $this->container->get('entity_type.manager')->getStorage('node');
     $type_name = 'article';
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $storage = $this->createFileField($field_name, 'node', $type_name, [], ['required' => '1']);
     $field = FieldConfig::loadByName('node', $type_name, $field_name);
 
@@ -78,7 +78,7 @@ public function testRequired() {
   public function testFileMaxSize() {
     $node_storage = $this->container->get('entity_type.manager')->getStorage('node');
     $type_name = 'article';
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createFileField($field_name, 'node', $type_name, [], ['required' => '1']);
 
     // 128KB.
@@ -130,7 +130,7 @@ public function testFileMaxSize() {
   public function testFileExtension() {
     $node_storage = $this->container->get('entity_type.manager')->getStorage('node');
     $type_name = 'article';
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createFileField($field_name, 'node', $type_name);
 
     $test_file = $this->getTestFile('image');
diff --git a/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php b/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php
index 4f9051979a4d..83e12945fd60 100644
--- a/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php
+++ b/core/modules/file/tests/src/Functional/FileFieldWidgetTest.php
@@ -81,7 +81,7 @@ protected function createTemporaryFile($data, UserInterface $user = NULL) {
   public function testSingleValuedWidget() {
     $node_storage = $this->container->get('entity_type.manager')->getStorage('node');
     $type_name = 'article';
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createFileField($field_name, 'node', $type_name);
 
     $test_file = $this->getTestFile('text');
@@ -250,7 +250,7 @@ public function testPrivateFileSetting() {
     user_role_grant_permissions($this->adminUser->roles[0]->target_id, ['administer node fields']);
 
     $type_name = 'article';
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createFileField($field_name, 'node', $type_name);
     $field = FieldConfig::loadByName('node', $type_name, $field_name);
     $field_id = $field->id();
@@ -299,7 +299,7 @@ public function testPrivateFileComment() {
     // Create a new field.
     $this->addDefaultCommentField('node', 'article');
 
-    $name = strtolower($this->randomMachineName());
+    $name = $this->randomMachineName();
     $label = $this->randomMachineName();
     $storage_edit = ['settings[uri_scheme]' => 'private'];
     $this->fieldUIAddNewField('admin/structure/comment/manage/comment', $name, $label, 'file', $storage_edit);
@@ -362,7 +362,7 @@ public function testPrivateFileComment() {
    */
   public function testWidgetValidation() {
     $type_name = 'article';
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createFileField($field_name, 'node', $type_name);
     $this->updateFileField($field_name, $type_name, ['file_extensions' => 'txt']);
 
@@ -391,7 +391,7 @@ public function testWidgetValidation() {
    * Tests file widget element.
    */
   public function testWidgetElement() {
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $html_name = str_replace('_', '-', $field_name);
     $this->createFileField($field_name, 'node', 'article', ['cardinality' => FieldStorageConfig::CARDINALITY_UNLIMITED]);
     $file = $this->getTestFile('text');
@@ -477,7 +477,7 @@ public function testMaximumUploadFileSizeValidation() {
     user_role_grant_permissions($this->adminUser->roles[0]->target_id, ['administer node fields']);
 
     $type_name = 'article';
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createFileField($field_name, 'node', $type_name);
     /** @var \Drupal\Field\FieldConfigInterface $field */
     $field = FieldConfig::loadByName('node', $type_name, $field_name);
@@ -504,7 +504,7 @@ public function testFileExtensionsSetting() {
     user_role_grant_permissions($this->adminUser->roles[0]->target_id, ['administer node fields']);
 
     $type_name = 'article';
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createFileField($field_name, 'node', $type_name);
     $field = FieldConfig::loadByName('node', $type_name, $field_name);
     $field_id = $field->id();
diff --git a/core/modules/file/tests/src/Functional/FileOnTranslatedEntityTest.php b/core/modules/file/tests/src/Functional/FileOnTranslatedEntityTest.php
index cce9408ceb10..41df460cb714 100644
--- a/core/modules/file/tests/src/Functional/FileOnTranslatedEntityTest.php
+++ b/core/modules/file/tests/src/Functional/FileOnTranslatedEntityTest.php
@@ -45,7 +45,7 @@ protected function setUp(): void {
     $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page', 'new_revision' => FALSE]);
 
     // Create a file field on the "Basic page" node type.
-    $this->fieldName = strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
     $this->createFileField($this->fieldName, 'node', 'page');
 
     // Create and log in user.
diff --git a/core/modules/file/tests/src/Functional/FilePrivateTest.php b/core/modules/file/tests/src/Functional/FilePrivateTest.php
index 9eb41af8f6bd..05d1bba1c989 100644
--- a/core/modules/file/tests/src/Functional/FilePrivateTest.php
+++ b/core/modules/file/tests/src/Functional/FilePrivateTest.php
@@ -47,7 +47,7 @@ public function testPrivateFile() {
     /** @var \Drupal\Core\File\FileSystemInterface $file_system */
     $file_system = \Drupal::service('file_system');
     $type_name = 'article';
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createFileField($field_name, 'node', $type_name, ['uri_scheme' => 'private']);
 
     $test_file = $this->getTestFile('text');
diff --git a/core/modules/file/tests/src/Functional/FileTokenReplaceTest.php b/core/modules/file/tests/src/Functional/FileTokenReplaceTest.php
index 86fe0ed5d176..67cb13cb2b67 100644
--- a/core/modules/file/tests/src/Functional/FileTokenReplaceTest.php
+++ b/core/modules/file/tests/src/Functional/FileTokenReplaceTest.php
@@ -31,7 +31,7 @@ public function testFileTokenReplacement() {
 
     // Create file field.
     $type_name = 'article';
-    $field_name = 'field_' . strtolower($this->randomMachineName());
+    $field_name = 'field_' . $this->randomMachineName();
     $this->createFileField($field_name, 'node', $type_name);
 
     $test_file = $this->getTestFile('text');
diff --git a/core/modules/file/tests/src/Functional/Formatter/FileMediaFormatterTestBase.php b/core/modules/file/tests/src/Functional/Formatter/FileMediaFormatterTestBase.php
index df630fad2a1f..af57e3d7c9a4 100644
--- a/core/modules/file/tests/src/Functional/Formatter/FileMediaFormatterTestBase.php
+++ b/core/modules/file/tests/src/Functional/Formatter/FileMediaFormatterTestBase.php
@@ -46,7 +46,7 @@ protected function setUp(): void {
    */
   protected function createMediaField($formatter, $file_extensions, array $formatter_settings = []) {
     $entity_type = $bundle = 'entity_test';
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
 
     FieldStorageConfig::create([
       'entity_type' => $entity_type,
diff --git a/core/modules/file/tests/src/Functional/PrivateFileOnTranslatedEntityTest.php b/core/modules/file/tests/src/Functional/PrivateFileOnTranslatedEntityTest.php
index d116babc53f2..8f40b33c09df 100644
--- a/core/modules/file/tests/src/Functional/PrivateFileOnTranslatedEntityTest.php
+++ b/core/modules/file/tests/src/Functional/PrivateFileOnTranslatedEntityTest.php
@@ -39,7 +39,7 @@ protected function setUp(): void {
     $this->drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']);
 
     // Create a file field on the "Basic page" node type.
-    $this->fieldName = strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
     $this->createFileField($this->fieldName, 'node', 'page', ['uri_scheme' => 'private']);
 
     // Create and log in user.
diff --git a/core/modules/file/tests/src/FunctionalJavascript/FileFieldValidateTest.php b/core/modules/file/tests/src/FunctionalJavascript/FileFieldValidateTest.php
index 1d50b3bfd7a4..450280276166 100644
--- a/core/modules/file/tests/src/FunctionalJavascript/FileFieldValidateTest.php
+++ b/core/modules/file/tests/src/FunctionalJavascript/FileFieldValidateTest.php
@@ -33,7 +33,7 @@ class FileFieldValidateTest extends WebDriverTestBase {
    * Tests the validation message is displayed only once for ajax uploads.
    */
   public function testAjaxValidationMessage() {
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->drupalCreateContentType(['type' => 'article', 'name' => 'Article']);
     $this->createFileField($field_name, 'node', 'article', [], ['file_extensions' => 'txt']);
 
diff --git a/core/modules/filter/tests/src/Functional/FilterAdminTest.php b/core/modules/filter/tests/src/Functional/FilterAdminTest.php
index a947bb841af6..4eb5daab4746 100644
--- a/core/modules/filter/tests/src/Functional/FilterAdminTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterAdminTest.php
@@ -129,7 +129,7 @@ public function testFormatAdmin() {
     // Add text format.
     $this->drupalGet('admin/config/content/formats');
     $this->clickLink('Add text format');
-    $format_id = mb_strtolower($this->randomMachineName());
+    $format_id = $this->randomMachineName();
     $name = $this->randomMachineName();
     $edit = [
       'format' => $format_id,
@@ -248,7 +248,7 @@ public function testFilterAdmin() {
 
     // Add format.
     $edit = [];
-    $edit['format'] = mb_strtolower($this->randomMachineName());
+    $edit['format'] = $this->randomMachineName();
     $edit['name'] = $this->randomMachineName();
     $edit['roles[' . RoleInterface::AUTHENTICATED_ID . ']'] = 1;
     $edit['filters[' . $second_filter . '][status]'] = TRUE;
@@ -412,14 +412,14 @@ public function testFilterTipHtmlEscape() {
    */
   public function testDisabledFormat() {
     // Create a node type and add a standard body field.
-    $node_type = NodeType::create(['type' => mb_strtolower($this->randomMachineName())]);
+    $node_type = NodeType::create(['type' => $this->randomMachineName()]);
     $node_type->save();
     node_add_body_field($node_type, $this->randomString());
 
     // Create a text format with a filter that returns a static string.
     $format = FilterFormat::create([
       'name' => $this->randomString(),
-      'format' => $format_id = mb_strtolower($this->randomMachineName()),
+      'format' => $format_id = $this->randomMachineName(),
     ]);
     $format->setFilterConfig('filter_static_text', ['status' => TRUE]);
     $format->save();
diff --git a/core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php b/core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php
index a2a9a415ebf3..97ef25a641e8 100644
--- a/core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterDefaultFormatTest.php
@@ -35,7 +35,7 @@ public function testDefaultTextFormats() {
     $formats = [];
     for ($i = 0; $i < 2; $i++) {
       $edit = [
-        'format' => mb_strtolower($this->randomMachineName()),
+        'format' => $this->randomMachineName(),
         'name' => $this->randomMachineName(),
       ];
       $this->drupalGet('admin/config/content/formats/add');
diff --git a/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php b/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php
index 98cc8e42d574..e96a7c806aa2 100644
--- a/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterFormatAccessTest.php
@@ -94,7 +94,7 @@ protected function setUp(): void {
     $formats = [];
     for ($i = 0; $i < 3; $i++) {
       $edit = [
-        'format' => mb_strtolower($this->randomMachineName()),
+        'format' => $this->randomMachineName(),
         'name' => $this->randomMachineName(),
       ];
       $this->drupalGet('admin/config/content/formats/add');
diff --git a/core/modules/filter/tests/src/Functional/FilterHooksTest.php b/core/modules/filter/tests/src/Functional/FilterHooksTest.php
index c8e33190b867..e80141bc696f 100644
--- a/core/modules/filter/tests/src/Functional/FilterHooksTest.php
+++ b/core/modules/filter/tests/src/Functional/FilterHooksTest.php
@@ -32,7 +32,7 @@ class FilterHooksTest extends BrowserTestBase {
    */
   public function testFilterHooks() {
     // Create content type, with underscores.
-    $type_name = 'test_' . strtolower($this->randomMachineName());
+    $type_name = 'test_' . $this->randomMachineName();
     $type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
     $node_permission = "create $type_name content";
 
@@ -46,7 +46,7 @@ public function testFilterHooks() {
     // Add a text format.
     $name = $this->randomMachineName();
     $edit = [];
-    $edit['format'] = mb_strtolower($this->randomMachineName());
+    $edit['format'] = $this->randomMachineName();
     $edit['name'] = $name;
     $edit['roles[' . RoleInterface::ANONYMOUS_ID . ']'] = 1;
     $this->drupalGet('admin/config/content/formats/add');
diff --git a/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php b/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php
index 38f8ded293e1..d62f0a0e3d94 100644
--- a/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php
+++ b/core/modules/image/tests/src/Functional/ImageAdminStylesTest.php
@@ -80,7 +80,7 @@ public function testStyle() {
     $admin_path = 'admin/config/media/image-styles';
 
     // Setup a style to be created and effects to add to it.
-    $style_name = strtolower($this->randomMachineName(10));
+    $style_name = $this->randomMachineName(10);
     $style_label = $this->randomString();
     $style_path = $admin_path . '/manage/' . $style_name;
     $effect_edits = [
@@ -197,7 +197,7 @@ public function testStyle() {
 
     // Test the style overview form.
     // Change the name of the style and adjust the weights of effects.
-    $style_name = strtolower($this->randomMachineName(10));
+    $style_name = $this->randomMachineName(10);
     $style_label = $this->randomMachineName();
     $weight = count($effect_edits);
     $edit = [
@@ -317,14 +317,14 @@ public function testStyle() {
    */
   public function testStyleReplacement() {
     // Create a new style.
-    $style_name = strtolower($this->randomMachineName(10));
+    $style_name = $this->randomMachineName(10);
     $style_label = $this->randomString();
     $style = ImageStyle::create(['name' => $style_name, 'label' => $style_label]);
     $style->save();
     $style_path = 'admin/config/media/image-styles/manage/';
 
     // Create an image field that uses the new style.
-    $field_name = strtolower($this->randomMachineName(10));
+    $field_name = $this->randomMachineName(10);
     $this->createImageField($field_name, 'article');
     \Drupal::service('entity_display.repository')
       ->getViewDisplay('node', 'article')
@@ -351,7 +351,7 @@ public function testStyleReplacement() {
     $this->assertSession()->responseContains($file_url_generator->transformRelative($style->buildUrl($original_uri)));
 
     // Rename the style and make sure the image field is updated.
-    $new_style_name = strtolower($this->randomMachineName(10));
+    $new_style_name = $this->randomMachineName(10);
     $new_style_label = $this->randomString();
     $edit = [
       'name' => $new_style_name,
@@ -441,7 +441,7 @@ public function testFlushUserInterface() {
     $admin_path = 'admin/config/media/image-styles';
 
     // Create a new style.
-    $style_name = strtolower($this->randomMachineName(10));
+    $style_name = $this->randomMachineName(10);
     $style = ImageStyle::create(['name' => $style_name, 'label' => $this->randomString()]);
     $style->save();
 
@@ -471,13 +471,13 @@ public function testFlushUserInterface() {
    */
   public function testConfigImport() {
     // Create a new style.
-    $style_name = strtolower($this->randomMachineName(10));
+    $style_name = $this->randomMachineName(10);
     $style_label = $this->randomString();
     $style = ImageStyle::create(['name' => $style_name, 'label' => $style_label]);
     $style->save();
 
     // Create an image field that uses the new style.
-    $field_name = strtolower($this->randomMachineName(10));
+    $field_name = $this->randomMachineName(10);
     $this->createImageField($field_name, 'article');
     \Drupal::service('entity_display.repository')
       ->getViewDisplay('node', 'article')
diff --git a/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php b/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php
index 7ee4a19a4517..9ac7dd18f3e2 100644
--- a/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php
+++ b/core/modules/image/tests/src/Functional/ImageFieldDefaultImagesTest.php
@@ -62,7 +62,7 @@ public function testDefaultImages() {
 
     // Create an image field storage and add a field to the article content
     // type.
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $storage_settings['default_image'] = [
       'uuid' => $default_images['field_storage']->uuid(),
       'alt' => '',
@@ -261,7 +261,7 @@ public function testDefaultImages() {
    */
   public function testInvalidDefaultImage() {
     $field_storage = FieldStorageConfig::create([
-      'field_name' => mb_strtolower($this->randomMachineName()),
+      'field_name' => $this->randomMachineName(),
       'entity_type' => 'node',
       'type' => 'image',
       'settings' => [
diff --git a/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php b/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php
index 7502129a79a0..4874e98f4997 100644
--- a/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php
+++ b/core/modules/image/tests/src/Functional/ImageFieldDisplayTest.php
@@ -59,7 +59,7 @@ public function _testImageFieldFormatters($scheme) {
     /** @var \Drupal\Core\Render\RendererInterface $renderer */
     $renderer = $this->container->get('renderer');
     $node_storage = $this->container->get('entity_type.manager')->getStorage('node');
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_settings = ['alt_field_required' => 0];
     $instance = $this->createImageField($field_name, 'article', ['uri_scheme' => $scheme], $field_settings);
 
@@ -246,7 +246,7 @@ public function testImageFieldSettings() {
     $node_storage = $this->container->get('entity_type.manager')->getStorage('node');
     $test_image = current($this->drupalGetTestFiles('image'));
     [, $test_image_extension] = explode('.', $test_image->filename);
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_settings = [
       'alt_field' => 1,
       'file_extensions' => $test_image_extension,
@@ -364,7 +364,7 @@ public function testImageLoadingAttribute(): void {
     /** @var \Drupal\Core\Render\RendererInterface $renderer */
     $renderer = $this->container->get('renderer');
     $node_storage = $this->container->get('entity_type.manager')->getStorage('node');
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_settings = ['alt_field_required' => 0];
     $instance = $this->createImageField($field_name, 'article', [], $field_settings);
 
@@ -480,7 +480,7 @@ public function testImageFieldDefaultImage() {
 
     $node_storage = $this->container->get('entity_type.manager')->getStorage('node');
     // Create a new image field.
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createImageField($field_name, 'article');
 
     // Create a new node, with no images and verify that no images are
@@ -569,7 +569,7 @@ public function testImageFieldDefaultImage() {
     $this->assertEmpty($default_image['uuid'], 'Default image removed from field.');
     // Create an image field that uses the private:// scheme and test that the
     // default image works as expected.
-    $private_field_name = strtolower($this->randomMachineName());
+    $private_field_name = $this->randomMachineName();
     $this->createImageField($private_field_name, 'article', ['uri_scheme' => 'private']);
     // Add a default image to the new field.
     $edit = [
diff --git a/core/modules/image/tests/src/Functional/ImageFieldValidateTest.php b/core/modules/image/tests/src/Functional/ImageFieldValidateTest.php
index 6bd66cf834a8..3228669215a8 100644
--- a/core/modules/image/tests/src/Functional/ImageFieldValidateTest.php
+++ b/core/modules/image/tests/src/Functional/ImageFieldValidateTest.php
@@ -29,7 +29,7 @@ public function testValid() {
     $file_system = $this->container->get('file_system');
     $image_files = $this->drupalGetTestFiles('image');
 
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createImageField($field_name, 'article', [], ['file_directory' => 'test-upload']);
     $expected_path = 'public://test-upload';
 
@@ -89,9 +89,9 @@ public function testValid() {
    */
   public function testResolution() {
     $field_names = [
-      0 => strtolower($this->randomMachineName()),
-      1 => strtolower($this->randomMachineName()),
-      2 => strtolower($this->randomMachineName()),
+      0 => $this->randomMachineName(),
+      1 => $this->randomMachineName(),
+      2 => $this->randomMachineName(),
     ];
     $min_resolution = [
       'width' => 50,
@@ -163,7 +163,7 @@ public function testResolution() {
    * Tests that required alt/title fields gets validated right.
    */
   public function testRequiredAttributes() {
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_settings = [
       'alt_field' => 1,
       'alt_field_required' => 1,
diff --git a/core/modules/image/tests/src/Functional/ImageFieldWidgetTest.php b/core/modules/image/tests/src/Functional/ImageFieldWidgetTest.php
index 607435d91f95..6d90777c4347 100644
--- a/core/modules/image/tests/src/Functional/ImageFieldWidgetTest.php
+++ b/core/modules/image/tests/src/Functional/ImageFieldWidgetTest.php
@@ -21,7 +21,7 @@ class ImageFieldWidgetTest extends ImageFieldTestBase {
    */
   public function testWidgetElement() {
     // Check for image widget in add/node/article page
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $min_resolution = 50;
     $max_resolution = 100;
     $field_settings = [
diff --git a/core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php b/core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php
index 64d2f92c7477..19538f36aea3 100644
--- a/core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php
+++ b/core/modules/image/tests/src/Functional/ImageOnTranslatedEntityTest.php
@@ -49,7 +49,7 @@ protected function setUp(): void {
     $this->drupalCreateContentType(['type' => 'basicpage', 'name' => 'Basic page', 'new_revision' => FALSE]);
 
     // Create an image field on the "Basic page" node type.
-    $this->fieldName = strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
     $this->createImageField($this->fieldName, 'basicpage', [], ['title_field' => 1]);
 
     // Create and log in user.
diff --git a/core/modules/image/tests/src/Functional/ImageStyleFlushTest.php b/core/modules/image/tests/src/Functional/ImageStyleFlushTest.php
index 820bedffa288..177186466763 100644
--- a/core/modules/image/tests/src/Functional/ImageStyleFlushTest.php
+++ b/core/modules/image/tests/src/Functional/ImageStyleFlushTest.php
@@ -60,7 +60,7 @@ public function getImageCount($style, $wrapper) {
   public function testFlush() {
 
     // Setup a style to be created and effects to add to it.
-    $style_name = strtolower($this->randomMachineName(10));
+    $style_name = $this->randomMachineName(10);
     $style_label = $this->randomString();
     $style_path = 'admin/config/media/image-styles/manage/' . $style_name;
     $effect_edits = [
diff --git a/core/modules/image/tests/src/FunctionalJavascript/ImageAdminStylesTest.php b/core/modules/image/tests/src/FunctionalJavascript/ImageAdminStylesTest.php
index f7b5b68d5154..ec53cc58e734 100644
--- a/core/modules/image/tests/src/FunctionalJavascript/ImageAdminStylesTest.php
+++ b/core/modules/image/tests/src/FunctionalJavascript/ImageAdminStylesTest.php
@@ -23,7 +23,7 @@ public function testAjaxEnabledEffectForm() {
     $admin_path = 'admin/config/media/image-styles';
 
     // Setup a style to be created and effects to add to it.
-    $style_name = strtolower($this->randomMachineName(10));
+    $style_name = $this->randomMachineName(10);
     $style_label = $this->randomString();
     $style_path = $admin_path . '/manage/' . $style_name;
     $effect_edit = [
diff --git a/core/modules/image/tests/src/FunctionalJavascript/ImageFieldValidateTest.php b/core/modules/image/tests/src/FunctionalJavascript/ImageFieldValidateTest.php
index b0a198312f8d..1bfe3e692e11 100644
--- a/core/modules/image/tests/src/FunctionalJavascript/ImageFieldValidateTest.php
+++ b/core/modules/image/tests/src/FunctionalJavascript/ImageFieldValidateTest.php
@@ -21,7 +21,7 @@ class ImageFieldValidateTest extends ImageFieldTestBase {
    * Tests the validation message is displayed only once for ajax uploads.
    */
   public function testAJAXValidationMessage() {
-    $field_name = strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createImageField($field_name, 'article', ['cardinality' => -1]);
 
     $this->drupalGet('node/add/article');
diff --git a/core/modules/image/tests/src/Kernel/ImageFormatterTest.php b/core/modules/image/tests/src/Kernel/ImageFormatterTest.php
index 0def1eea4163..b2f67d1c4b29 100644
--- a/core/modules/image/tests/src/Kernel/ImageFormatterTest.php
+++ b/core/modules/image/tests/src/Kernel/ImageFormatterTest.php
@@ -58,7 +58,7 @@ protected function setUp(): void {
 
     $this->entityType = 'entity_test';
     $this->bundle = $this->entityType;
-    $this->fieldName = mb_strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
 
     FieldStorageConfig::create([
       'entity_type' => $this->entityType,
diff --git a/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php b/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php
index 2bd7360721c7..2c1f529f5041 100644
--- a/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php
+++ b/core/modules/language/tests/src/Functional/ConfigurableLanguageManagerTest.php
@@ -212,8 +212,8 @@ public function testUserProfileTranslationWithPreferredAdminLanguage() {
     ]);
 
     // Create a field on the user entity.
-    $field_name = mb_strtolower($this->randomMachineName());
-    $label = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
+    $label = $this->randomMachineName();
     $field_label_en = "English $label";
     $field_label_es = "Español $label";
 
diff --git a/core/modules/link/tests/src/Functional/LinkFieldTest.php b/core/modules/link/tests/src/Functional/LinkFieldTest.php
index 9f1255bce7bd..c6d2be3bd274 100644
--- a/core/modules/link/tests/src/Functional/LinkFieldTest.php
+++ b/core/modules/link/tests/src/Functional/LinkFieldTest.php
@@ -86,7 +86,7 @@ public function testLinkField() {
    * Tests link field URL validation.
    */
   protected function doTestURLValidation() {
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     // Create a field with settings to validate.
     $this->fieldStorage = FieldStorageConfig::create([
       'field_name' => $field_name,
@@ -270,7 +270,7 @@ protected function assertInvalidEntries(string $field_name, array $invalid_entri
    * Tests the link title settings of a link field.
    */
   protected function doTestLinkTitle() {
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     // Create a field with settings to validate.
     $this->fieldStorage = FieldStorageConfig::create([
       'field_name' => $field_name,
@@ -395,7 +395,7 @@ protected function doTestLinkTitle() {
    * Tests the default 'link' formatter.
    */
   protected function doTestLinkFormatter() {
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     // Create a field with settings to validate.
     $this->fieldStorage = FieldStorageConfig::create([
       'field_name' => $field_name,
@@ -552,7 +552,7 @@ protected function doTestLinkFormatter() {
    * merged, since they involve different configuration and output.
    */
   protected function doTestLinkSeparateFormatter() {
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     // Create a field with settings to validate.
     $this->fieldStorage = FieldStorageConfig::create([
       'field_name' => $field_name,
@@ -681,7 +681,7 @@ protected function doTestLinkSeparateFormatter() {
   protected function doTestLinkTypeOnLinkWidget() {
 
     $link_type = LinkItemInterface::LINK_EXTERNAL;
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
 
     // Create a field with settings to validate.
     $this->fieldStorage = FieldStorageConfig::create([
@@ -779,7 +779,7 @@ protected function doTestEditNonNodeEntityLink() {
    * Tests <nolink> and <none> as link uri.
    */
   public function testNoLinkUri() {
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->fieldStorage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
diff --git a/core/modules/media/tests/src/Functional/MediaTypeCreationTest.php b/core/modules/media/tests/src/Functional/MediaTypeCreationTest.php
index dd56dcebd400..7f245032154e 100644
--- a/core/modules/media/tests/src/Functional/MediaTypeCreationTest.php
+++ b/core/modules/media/tests/src/Functional/MediaTypeCreationTest.php
@@ -48,7 +48,7 @@ public function testMediaTypeCreationForm($button_label, $address, $machine_name
    * Data provider for testMediaTypeCreationForm().
    */
   public function providerMediaTypeCreationForm() {
-    $machine_name = mb_strtolower($this->randomMachineName());
+    $machine_name = $this->randomMachineName();
     return [
       [
         'Save',
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaViewsWizardTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaViewsWizardTest.php
index 4ebe977e505a..48c39732027e 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaViewsWizardTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaViewsWizardTest.php
@@ -29,7 +29,7 @@ public function testMediaWizard() {
 
     $this->createMediaType('test');
 
-    $view_id = strtolower($this->randomMachineName(16));
+    $view_id = $this->randomMachineName(16);
     $this->drupalGet('admin/structure/views/add');
     $page->fillField('label', $view_id);
     $this->waitUntilVisible('.machine-name-value');
@@ -63,7 +63,7 @@ public function testMediaRevisionWizard() {
     $page = $session->getPage();
     $assert_session = $this->assertSession();
 
-    $view_id = strtolower($this->randomMachineName(16));
+    $view_id = $this->randomMachineName(16);
     $this->drupalGet('admin/structure/views/add');
     $page->fillField('label', $view_id);
     $this->waitUntilVisible('.machine-name-value');
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php
index 85aa57bf10ec..b82c66567501 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiLanguageTest.php
@@ -61,7 +61,7 @@ protected function setUp(): void {
   public function testMenuLanguage() {
     // Create a test menu to test the various language-related settings.
     // Machine name has to be lowercase.
-    $menu_name = mb_strtolower($this->randomMachineName(16));
+    $menu_name = $this->randomMachineName(16);
     $label = $this->randomString();
     $edit = [
       'id' => $menu_name,
diff --git a/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
index 2d8b3223e74e..9cb7d40d03a7 100644
--- a/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
+++ b/core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
@@ -226,7 +226,7 @@ public function testMenuAdministration() {
    */
   public function addCustomMenuCRUD() {
     // Add a new custom menu.
-    $menu_name = strtolower($this->randomMachineName(MenuStorage::MAX_ID_LENGTH));
+    $menu_name = $this->randomMachineName(MenuStorage::MAX_ID_LENGTH);
     $label = $this->randomMachineName(16);
 
     $menu = Menu::create([
@@ -267,7 +267,7 @@ public function addCustomMenuCRUD() {
   public function addCustomMenu() {
     // Try adding a menu using a menu_name that is too long.
     $this->drupalGet('admin/structure/menu/add');
-    $menu_name = strtolower($this->randomMachineName(MenuStorage::MAX_ID_LENGTH + 1));
+    $menu_name = $this->randomMachineName(MenuStorage::MAX_ID_LENGTH + 1);
     $label = $this->randomMachineName(16);
     $edit = [
       'id' => $menu_name,
@@ -282,7 +282,7 @@ public function addCustomMenu() {
     $this->assertSession()->pageTextContains("Menu name cannot be longer than " . MenuStorage::MAX_ID_LENGTH . " characters but is currently " . mb_strlen($menu_name) . " characters long.");
 
     // Change the menu_name so it no longer exceeds the maximum length.
-    $menu_name = strtolower($this->randomMachineName(MenuStorage::MAX_ID_LENGTH));
+    $menu_name = $this->randomMachineName(MenuStorage::MAX_ID_LENGTH);
     $edit['id'] = $menu_name;
     $this->drupalGet('admin/structure/menu/add');
     $this->submitForm($edit, 'Save');
diff --git a/core/modules/menu_ui/tests/src/FunctionalJavascript/MenuUiJavascriptTest.php b/core/modules/menu_ui/tests/src/FunctionalJavascript/MenuUiJavascriptTest.php
index 3eef94fcf795..277a67fcff3a 100644
--- a/core/modules/menu_ui/tests/src/FunctionalJavascript/MenuUiJavascriptTest.php
+++ b/core/modules/menu_ui/tests/src/FunctionalJavascript/MenuUiJavascriptTest.php
@@ -75,7 +75,7 @@ public function testBlockContextualLinks() {
   protected function addCustomMenu() {
     // Try adding a menu using a menu_name that is too long.
     $label = $this->randomMachineName(16);
-    $menu_id = strtolower($this->randomMachineName(MenuStorage::MAX_ID_LENGTH + 1));
+    $menu_id = $this->randomMachineName(MenuStorage::MAX_ID_LENGTH + 1);
 
     $this->drupalGet('admin/structure/menu/add');
     $page = $this->getSession()->getPage();
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateEntityContentValidationTest.php b/core/modules/migrate/tests/src/Kernel/MigrateEntityContentValidationTest.php
index ef53d918ca07..e3091bb80642 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateEntityContentValidationTest.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateEntityContentValidationTest.php
@@ -188,7 +188,7 @@ public function testEntityOwnerValidation() {
     $normal_user->save();
 
     // Add a "body" field with the text format.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
diff --git a/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php b/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php
index 97c30c9a2116..ed685ab49061 100644
--- a/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php
+++ b/core/modules/node/tests/src/Functional/MultiStepNodeFormBasicOptionsTest.php
@@ -36,7 +36,7 @@ public function testMultiStepNodeFormBasicOptions() {
     $this->drupalLogin($web_user);
 
     // Create an unlimited cardinality field.
-    $this->fieldName = mb_strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
     FieldStorageConfig::create([
       'field_name' => $this->fieldName,
       'entity_type' => 'node',
diff --git a/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php b/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
index 44d9135c4bb7..22154a24d8b2 100644
--- a/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
+++ b/core/modules/node/tests/src/Functional/NodeAccessFieldTest.php
@@ -65,7 +65,7 @@ protected function setUp(): void {
     ]);
 
     // Add a custom field to the page content type.
-    $this->fieldName = mb_strtolower($this->randomMachineName() . '_field_name');
+    $this->fieldName = $this->randomMachineName() . '_field_name';
     FieldStorageConfig::create([
       'field_name' => $this->fieldName,
       'entity_type' => 'node',
diff --git a/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php b/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
index 049243c41e17..ea2bcd9fc29f 100644
--- a/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
+++ b/core/modules/node/tests/src/Functional/NodeBlockFunctionalTest.php
@@ -148,7 +148,7 @@ public function testRecentNodeBlock() {
     $this->drupalGet("admin/structure/block/add/system_powered_by_block/{$theme}");
     $this->assertSession()->pageTextContains('Content type');
     $edit = [
-      'id' => strtolower($this->randomMachineName()),
+      'id' => $this->randomMachineName(),
       'region' => 'sidebar_first',
       'visibility[entity_bundle:node][bundles][article]' => 'article',
     ];
diff --git a/core/modules/node/tests/src/Functional/NodeTypeTranslationTest.php b/core/modules/node/tests/src/Functional/NodeTypeTranslationTest.php
index 29164b87b914..bbab173121b8 100644
--- a/core/modules/node/tests/src/Functional/NodeTypeTranslationTest.php
+++ b/core/modules/node/tests/src/Functional/NodeTypeTranslationTest.php
@@ -103,7 +103,7 @@ protected function installParameters() {
    * Tests the node type translation.
    */
   public function testNodeTypeTranslation() {
-    $type = mb_strtolower($this->randomMachineName(16));
+    $type = $this->randomMachineName(16);
     $name = $this->randomString();
     $this->drupalLogin($this->adminUser);
     $this->drupalCreateContentType(['type' => $type, 'name' => $name]);
@@ -140,7 +140,7 @@ public function testNodeTypeTranslation() {
    * Tests the node type title label translation.
    */
   public function testNodeTypeTitleLabelTranslation() {
-    $type = mb_strtolower($this->randomMachineName(16));
+    $type = $this->randomMachineName(16);
     $name = $this->randomString();
     $this->drupalLogin($this->adminUser);
     $this->drupalCreateContentType(['type' => $type, 'name' => $name]);
@@ -176,7 +176,7 @@ public function testNodeTypeTitleLabelTranslation() {
     $this->submitForm([], 'Save field settings');
     $this->submitForm([], 'Save settings');
 
-    $type = mb_strtolower($this->randomMachineName(16));
+    $type = $this->randomMachineName(16);
     $name = $this->randomString();
     $this->drupalCreateContentType(['type' => $type, 'name' => $name]);
 
diff --git a/core/modules/node/tests/src/Functional/PagePreviewTest.php b/core/modules/node/tests/src/Functional/PagePreviewTest.php
index 9303d6d7c8d4..a3b3f73c2e42 100644
--- a/core/modules/node/tests/src/Functional/PagePreviewTest.php
+++ b/core/modules/node/tests/src/Functional/PagePreviewTest.php
@@ -120,7 +120,7 @@ protected function setUp(): void {
     $field_config->save();
 
     // Create a field.
-    $this->fieldName = mb_strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
     $handler_settings = [
       'target_bundles' => [
         $vocabulary->id() => $vocabulary->id(),
diff --git a/core/modules/node/tests/src/Functional/Views/Wizard/HiddenTaxonomyTermReferenceFieldWizardTest.php b/core/modules/node/tests/src/Functional/Views/Wizard/HiddenTaxonomyTermReferenceFieldWizardTest.php
index d528dc39b4f0..4949b7c9af5c 100644
--- a/core/modules/node/tests/src/Functional/Views/Wizard/HiddenTaxonomyTermReferenceFieldWizardTest.php
+++ b/core/modules/node/tests/src/Functional/Views/Wizard/HiddenTaxonomyTermReferenceFieldWizardTest.php
@@ -37,7 +37,7 @@ public function testHiddenTaxonomyTermReferenceField() {
     // Create a taxonomy_term_reference field on the article Content Type. By
     // not assigning a widget to that field we make sure it is hidden on the
     // Form Display.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'node',
diff --git a/core/modules/node/tests/src/Functional/Views/Wizard/NodeRevisionWizardTest.php b/core/modules/node/tests/src/Functional/Views/Wizard/NodeRevisionWizardTest.php
index 17c05412828a..775ee5afe101 100644
--- a/core/modules/node/tests/src/Functional/Views/Wizard/NodeRevisionWizardTest.php
+++ b/core/modules/node/tests/src/Functional/Views/Wizard/NodeRevisionWizardTest.php
@@ -54,7 +54,7 @@ public function testViewAdd() {
 
     $view = [];
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['description'] = $this->randomMachineName(16);
     $view['page[create]'] = FALSE;
     $view['show[type]'] = 'article';
@@ -85,7 +85,7 @@ public function testViewAdd() {
     $this->submitForm($type, 'Update "Show" choice');
     $view = [];
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['description'] = $this->randomMachineName(16);
     $view['page[create]'] = FALSE;
     $view['show[type]'] = 'all';
diff --git a/core/modules/node/tests/src/Traits/ContentTypeCreationTrait.php b/core/modules/node/tests/src/Traits/ContentTypeCreationTrait.php
index 3d8bbe9ac526..127207894e81 100644
--- a/core/modules/node/tests/src/Traits/ContentTypeCreationTrait.php
+++ b/core/modules/node/tests/src/Traits/ContentTypeCreationTrait.php
@@ -27,7 +27,7 @@ protected function createContentType(array $values = []) {
     // Find a non-existent random type name.
     if (!isset($values['type'])) {
       do {
-        $id = strtolower($this->randomMachineName(8));
+        $id = $this->randomMachineName(8);
       } while (NodeType::load($id));
     }
     else {
diff --git a/core/modules/options/tests/src/Functional/OptionsFieldUITest.php b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
index 81f9348d3e13..93bbca1d0940 100644
--- a/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
+++ b/core/modules/options/tests/src/Functional/OptionsFieldUITest.php
@@ -80,7 +80,7 @@ protected function setUp(): void {
     $this->drupalLogin($admin_user);
 
     // Create content type, with underscores.
-    $this->typeName = 'test_' . strtolower($this->randomMachineName());
+    $this->typeName = 'test_' . $this->randomMachineName();
     $type = $this->drupalCreateContentType(['name' => $this->typeName, 'type' => $this->typeName]);
     $this->type = $type->id();
   }
@@ -390,7 +390,7 @@ public function assertAllowedValuesInput(array $input, $result, string $message)
    * Tests normal and key formatter display on node display.
    */
   public function testNodeDisplay() {
-    $this->fieldName = strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
     $this->createOptionsField('list_integer');
     $node = $this->drupalCreateNode(['type' => $this->type]);
 
diff --git a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php
index c99ee3084a6e..a86ad20e203f 100644
--- a/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php
+++ b/core/modules/responsive_image/tests/src/Functional/ResponsiveImageFieldDisplayTest.php
@@ -189,7 +189,7 @@ protected function doTestResponsiveImageFieldFormatters($scheme, $empty_styles =
     /** @var \Drupal\Core\Render\RendererInterface $renderer */
     $renderer = $this->container->get('renderer');
     $node_storage = $this->container->get('entity_type.manager')->getStorage('node');
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createImageField($field_name, 'article', ['uri_scheme' => $scheme]);
     // Create a new node with an image attached. Make sure we use a large image
     // so the scale effects of the image styles always have an effect.
@@ -385,7 +385,7 @@ public function testResponsiveImageFieldFormattersEmptyMediaQuery() {
       ])
       ->save();
     $node_storage = $this->container->get('entity_type.manager')->getStorage('node');
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createImageField($field_name, 'article', ['uri_scheme' => 'public']);
     // Create a new node with an image attached.
     $test_image = current($this->getTestFiles('image'));
@@ -460,7 +460,7 @@ public function testResponsiveImageFieldFormattersMultipleSources() {
       ])
       ->save();
     $node_storage = $this->container->get('entity_type.manager')->getStorage('node');
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createImageField($field_name, 'article', ['uri_scheme' => 'public']);
     // Create a new node with an image attached.
     $test_image = current($this->getTestFiles('image'));
@@ -515,7 +515,7 @@ public function testResponsiveImageFieldFormattersMultipleSources() {
    *   The link type to test. Either 'file' or 'content'.
    */
   private function assertResponsiveImageFieldFormattersLink(string $link_type): void {
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_settings = ['alt_field_required' => 0];
     $this->createImageField($field_name, 'article', ['uri_scheme' => 'public'], $field_settings);
     // Create a new node with an image attached.
diff --git a/core/modules/responsive_image/tests/src/FunctionalJavascript/ResponsiveImageFieldUiTest.php b/core/modules/responsive_image/tests/src/FunctionalJavascript/ResponsiveImageFieldUiTest.php
index 4409ec274712..73d77b69532b 100644
--- a/core/modules/responsive_image/tests/src/FunctionalJavascript/ResponsiveImageFieldUiTest.php
+++ b/core/modules/responsive_image/tests/src/FunctionalJavascript/ResponsiveImageFieldUiTest.php
@@ -59,7 +59,7 @@ protected function setUp(): void {
     $this->drupalLogin($admin_user);
 
     // Create content type, with underscores.
-    $type_name = strtolower($this->randomMachineName(8)) . '_test';
+    $type_name = $this->randomMachineName(8) . '_test';
     $type = $this->drupalCreateContentType([
       'name' => $type_name,
       'type' => $type_name,
diff --git a/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
index 451a1acccf21..8043c8def516 100644
--- a/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
+++ b/core/modules/search/tests/src/Functional/SearchConfigSettingsFormTest.php
@@ -280,8 +280,8 @@ public function testMultipleSearchPages() {
 
     $first = [];
     $first['label'] = $this->randomString();
-    $first_id = $first['id'] = strtolower($this->randomMachineName(8));
-    $first['path'] = strtolower($this->randomMachineName(8));
+    $first_id = $first['id'] = $this->randomMachineName(8);
+    $first['path'] = $this->randomMachineName(8);
     $this->submitForm($first, 'Save');
     $this->assertDefaultSearch($first_id, 'The default page matches the only search page.');
     $this->assertSession()->statusMessageContains("The {$first['label']} search page has been added.", 'status');
@@ -292,7 +292,7 @@ public function testMultipleSearchPages() {
     $this->submitForm($edit, 'Add search page');
     $edit = [];
     $edit['label'] = $this->randomString();
-    $edit['id'] = strtolower($this->randomMachineName(8));
+    $edit['id'] = $this->randomMachineName(8);
     $edit['path'] = $first['path'];
     $this->submitForm($edit, 'Save');
     $this->assertSession()->statusMessageContains('The search page path must be unique.', 'error');
@@ -300,8 +300,8 @@ public function testMultipleSearchPages() {
     // Add a second search page.
     $second = [];
     $second['label'] = $this->randomString();
-    $second_id = $second['id'] = strtolower($this->randomMachineName(8));
-    $second['path'] = strtolower($this->randomMachineName(8));
+    $second_id = $second['id'] = $this->randomMachineName(8);
+    $second['path'] = $this->randomMachineName(8);
     $this->submitForm($second, 'Save');
     $this->assertDefaultSearch($first_id, 'The default page matches the only search page.');
 
diff --git a/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php b/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php
index c6ed16cfb072..cd0d8edc1d5c 100644
--- a/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php
+++ b/core/modules/shortcut/tests/src/Functional/ShortcutLinksTest.php
@@ -130,7 +130,7 @@ public function testShortcutLinkAdd() {
     $this->drupalLogin($this->adminUser);
     $edit = [
       'label' => $this->randomMachineName(),
-      'id' => strtolower($this->randomMachineName()),
+      'id' => $this->randomMachineName(),
     ];
     $this->drupalGet('admin/config/user-interface/shortcut/add-set');
     $this->submitForm($edit, 'Save');
diff --git a/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php b/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php
index a01efd76f51f..0367d8960498 100644
--- a/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php
+++ b/core/modules/shortcut/tests/src/Functional/ShortcutSetsTest.php
@@ -40,7 +40,7 @@ public function testShortcutSetAdd() {
     $this->clickLink('Add shortcut set');
     $edit = [
       'label' => $this->randomMachineName(),
-      'id' => strtolower($this->randomMachineName()),
+      'id' => $this->randomMachineName(),
     ];
     $this->submitForm($edit, 'Save');
     $new_set = $this->container->get('entity_type.manager')->getStorage('shortcut_set')->load($edit['id']);
@@ -133,7 +133,7 @@ public function testShortcutSetAssign() {
   public function testShortcutSetSwitchCreate() {
     $edit = [
       'set' => 'new',
-      'id' => strtolower($this->randomMachineName()),
+      'id' => $this->randomMachineName(),
       'label' => $this->randomString(),
     ];
     $this->drupalGet('user/' . $this->adminUser->id() . '/shortcuts');
diff --git a/core/modules/shortcut/tests/src/Functional/ShortcutTestBase.php b/core/modules/shortcut/tests/src/Functional/ShortcutTestBase.php
index 0bd0cd7c6648..95c0b30de73c 100644
--- a/core/modules/shortcut/tests/src/Functional/ShortcutTestBase.php
+++ b/core/modules/shortcut/tests/src/Functional/ShortcutTestBase.php
@@ -113,7 +113,7 @@ protected function setUp(): void {
    */
   public function generateShortcutSet($label = '', $id = NULL) {
     $set = ShortcutSet::create([
-      'id' => $id ?? strtolower($this->randomMachineName()),
+      'id' => $id ?? $this->randomMachineName(),
       'label' => empty($label) ? $this->randomString() : $label,
     ]);
     $set->save();
diff --git a/core/modules/system/tests/src/Functional/Module/PrepareUninstallTest.php b/core/modules/system/tests/src/Functional/Module/PrepareUninstallTest.php
index 047b92c63fea..8d6bbe7ad61f 100644
--- a/core/modules/system/tests/src/Functional/Module/PrepareUninstallTest.php
+++ b/core/modules/system/tests/src/Functional/Module/PrepareUninstallTest.php
@@ -186,14 +186,14 @@ public function testUninstall() {
     $storage = $this->container->get('entity_type.manager')
       ->getStorage('entity_test_no_label');
     $storage->create([
-      'id' => mb_strtolower($this->randomMachineName()),
+      'id' => $this->randomMachineName(),
       'name' => $this->randomMachineName(),
     ])->save();
     $this->drupalGet('admin/modules/uninstall/entity/entity_test_no_label');
     $this->assertSession()->pageTextContains('This will delete 1 entity test without label.');
     $this->assertSession()->buttonExists("Delete all entity test without label entities");
     $storage->create([
-      'id' => mb_strtolower($this->randomMachineName()),
+      'id' => $this->randomMachineName(),
       'name' => $this->randomMachineName(),
     ])->save();
     $this->drupalGet('admin/modules/uninstall/entity/entity_test_no_label');
diff --git a/core/modules/system/tests/src/Functional/System/DateFormatsMachineNameTest.php b/core/modules/system/tests/src/Functional/System/DateFormatsMachineNameTest.php
index 1870b20b86b8..c9488fb99b99 100644
--- a/core/modules/system/tests/src/Functional/System/DateFormatsMachineNameTest.php
+++ b/core/modules/system/tests/src/Functional/System/DateFormatsMachineNameTest.php
@@ -63,7 +63,7 @@ public function testDateFormatsMachineNameAllowedValues() {
     $this->assertSession()->pageTextContains('The machine-readable name is already in use. It must be unique.');
 
     // Create a date format with a machine name distinct from the previous two.
-    $id = mb_strtolower($this->randomMachineName(16));
+    $id = $this->randomMachineName(16);
     $edit = [
       'label' => $this->randomMachineName(16),
       'id' => $id,
diff --git a/core/modules/system/tests/src/Functional/System/DateTimeTest.php b/core/modules/system/tests/src/Functional/System/DateTimeTest.php
index c96df16d4ffc..d6f62b7878c2 100644
--- a/core/modules/system/tests/src/Functional/System/DateTimeTest.php
+++ b/core/modules/system/tests/src/Functional/System/DateTimeTest.php
@@ -104,7 +104,7 @@ public function testDateFormatConfiguration() {
 
     // Add custom date format.
     $this->clickLink('Add format');
-    $date_format_id = strtolower($this->randomMachineName(8));
+    $date_format_id = $this->randomMachineName(8);
     $name = ucwords($date_format_id);
     $date_format = 'd.m.Y - H:i';
     $edit = [
@@ -156,7 +156,7 @@ public function testDateFormatConfiguration() {
     $this->assertNull($date_format);
 
     // Add a new date format with an existing format.
-    $date_format_id = strtolower($this->randomMachineName(8));
+    $date_format_id = $this->randomMachineName(8);
     $name = ucwords($date_format_id);
     $date_format = 'Y';
     $edit = [
@@ -186,7 +186,7 @@ public function testDateFormatConfiguration() {
     $this->assertSession()->assertEscaped("<script>alert('XSS');</script>");
 
     // Add a new date format with HTML in it.
-    $date_format_id = strtolower($this->randomMachineName(8));
+    $date_format_id = $this->randomMachineName(8);
     $name = ucwords($date_format_id);
     $date_format = '& \<\e\m\>Y\<\/\e\m\>';
     $edit = [
diff --git a/core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php b/core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php
index 44c79b602a88..4b42dfeb73c8 100644
--- a/core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php
+++ b/core/modules/system/tests/src/Kernel/Entity/EntityReferenceSelectionReferenceableTest.php
@@ -64,24 +64,24 @@ protected function setUp(): void {
 
     // Create a new node-type.
     NodeType::create([
-      'type' => $node_type = mb_strtolower($this->randomMachineName()),
+      'type' => $node_type = $this->randomMachineName(),
       'name' => $this->randomString(),
     ])->save();
 
     // Create an entity reference field targeting 'entity_test_no_label'
     // entities.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $this->createEntityReferenceField('node', $node_type, $field_name, $this->randomString(), 'entity_test_no_label');
     $field_config = FieldConfig::loadByName('node', $node_type, $field_name);
     $this->selectionHandler = $this->container->get('plugin.manager.entity_reference_selection')->getSelectionHandler($field_config);
 
     // Generate a bundle name to be used with 'entity_test_no_label'.
-    $this->bundle = mb_strtolower($this->randomMachineName());
+    $this->bundle = $this->randomMachineName();
 
     // Create 6 entities to be referenced by the field.
     foreach (static::$labels as $name) {
       $storage->create([
-        'id' => mb_strtolower($this->randomMachineName()),
+        'id' => $this->randomMachineName(),
         'name' => $name,
         'type' => $this->bundle,
       ])->save();
diff --git a/core/modules/taxonomy/tests/src/Functional/TermAutocompleteTest.php b/core/modules/taxonomy/tests/src/Functional/TermAutocompleteTest.php
index ba3c1aca2920..38b55075ab58 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermAutocompleteTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermAutocompleteTest.php
@@ -98,7 +98,7 @@ protected function setUp(): void {
 
     // Create a taxonomy_term_reference field on the article Content Type that
     // uses a taxonomy_autocomplete widget.
-    $this->fieldName = mb_strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
     FieldStorageConfig::create([
       'field_name' => $this->fieldName,
       'entity_type' => 'node',
diff --git a/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php b/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
index c5f7087827c3..a28e013e90ef 100644
--- a/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/TermIndexTest.php
@@ -61,7 +61,7 @@ protected function setUp(): void {
     // Create a vocabulary and add two term reference fields to article nodes.
     $this->vocabulary = $this->createVocabulary();
 
-    $this->fieldName1 = mb_strtolower($this->randomMachineName());
+    $this->fieldName1 = $this->randomMachineName();
     $handler_settings = [
       'target_bundles' => [
         $this->vocabulary->id() => $this->vocabulary->id(),
@@ -83,7 +83,7 @@ protected function setUp(): void {
       ])
       ->save();
 
-    $this->fieldName2 = mb_strtolower($this->randomMachineName());
+    $this->fieldName2 = $this->randomMachineName();
     $this->createEntityReferenceField('node', 'article', $this->fieldName2, NULL, 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
 
     /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $display_repository */
diff --git a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
index 90911684263c..ae953f1dd22c 100644
--- a/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/Views/TaxonomyTermViewTest.php
@@ -57,7 +57,7 @@ protected function setUp($import_test_views = TRUE, $modules = []): void {
 
     // Create a vocabulary and add two term reference fields to article nodes.
 
-    $this->fieldName1 = mb_strtolower($this->randomMachineName());
+    $this->fieldName1 = $this->randomMachineName();
 
     $handler_settings = [
       'target_bundles' => [
diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularyLanguageTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyLanguageTest.php
index 1dad37e3bc38..87dea7fa9ff1 100644
--- a/core/modules/taxonomy/tests/src/Functional/VocabularyLanguageTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/VocabularyLanguageTest.php
@@ -50,7 +50,7 @@ public function testVocabularyLanguage() {
     $this->assertSession()->fieldExists('edit-langcode');
 
     // Create the vocabulary.
-    $vid = mb_strtolower($this->randomMachineName());
+    $vid = $this->randomMachineName();
     $edit['name'] = $this->randomMachineName();
     $edit['description'] = $this->randomMachineName();
     $edit['langcode'] = 'aa';
@@ -79,7 +79,7 @@ public function testVocabularyDefaultLanguageForTerms() {
     // the terms are saved.
     $edit = [
       'name' => $this->randomMachineName(),
-      'vid' => mb_strtolower($this->randomMachineName()),
+      'vid' => $this->randomMachineName(),
       'default_language[langcode]' => 'bb',
       'default_language[language_alterable]' => TRUE,
     ];
diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php
index 4eb7cecce8b9..0503216cf6e6 100644
--- a/core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/VocabularyTranslationTest.php
@@ -61,7 +61,7 @@ public function testVocabularyLanguage() {
     $this->assertSession()->fieldExists('edit-default-language-content-translation');
 
     // Create the vocabulary.
-    $vid = mb_strtolower($this->randomMachineName());
+    $vid = $this->randomMachineName();
     $edit['name'] = $this->randomMachineName();
     $edit['description'] = $this->randomMachineName();
     $edit['langcode'] = 'en';
@@ -81,7 +81,7 @@ public function testVocabularyTitleLabelTranslation(): void {
     $this->drupalGet('admin/structure/taxonomy/add');
 
     // Create the vocabulary.
-    $vid = mb_strtolower($this->randomMachineName());
+    $vid = $this->randomMachineName();
     $edit['name'] = $this->randomMachineName();
     $edit['description'] = $this->randomMachineName();
     $edit['langcode'] = 'en';
diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php
index e4e89cce5367..412ceccde0f9 100644
--- a/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php
+++ b/core/modules/taxonomy/tests/src/Functional/VocabularyUiTest.php
@@ -46,7 +46,7 @@ public function testVocabularyInterface() {
     // Create a new vocabulary.
     $this->clickLink('Add vocabulary');
     $edit = [];
-    $vid = mb_strtolower($this->randomMachineName());
+    $vid = $this->randomMachineName();
     $edit['name'] = $this->randomMachineName();
     $edit['description'] = $this->randomMachineName();
     $edit['vid'] = $vid;
@@ -157,7 +157,7 @@ public function testTaxonomyAdminNoVocabularies() {
    */
   public function testTaxonomyAdminDeletingVocabulary() {
     // Create a vocabulary.
-    $vid = mb_strtolower($this->randomMachineName());
+    $vid = $this->randomMachineName();
     $edit = [
       'name' => $this->randomMachineName(),
       'vid' => $vid,
diff --git a/core/modules/taxonomy/tests/src/Kernel/TermHierarchyValidationTest.php b/core/modules/taxonomy/tests/src/Kernel/TermHierarchyValidationTest.php
index 8ff253d18eeb..ed7c772f2590 100644
--- a/core/modules/taxonomy/tests/src/Kernel/TermHierarchyValidationTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/TermHierarchyValidationTest.php
@@ -32,7 +32,7 @@ protected function setUp(): void {
    * Tests the term hierarchy validation with re-parenting in pending revisions.
    */
   public function testTermHierarchyValidation() {
-    $vocabulary_id = mb_strtolower($this->randomMachineName());
+    $vocabulary_id = $this->randomMachineName();
     $vocabulary = Vocabulary::create([
       'name' => $vocabulary_id,
       'vid' => $vocabulary_id,
diff --git a/core/modules/taxonomy/tests/src/Kernel/VocabularyCrudTest.php b/core/modules/taxonomy/tests/src/Kernel/VocabularyCrudTest.php
index e316e2e930aa..52f014b35c9f 100644
--- a/core/modules/taxonomy/tests/src/Kernel/VocabularyCrudTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/VocabularyCrudTest.php
@@ -128,7 +128,7 @@ public function testUninstallReinstall() {
     $vocabulary = $this->createVocabulary();
     // Field storages and fields attached to taxonomy term bundles should be
     // removed when the module is uninstalled.
-    $field_name = mb_strtolower($this->randomMachineName() . '_field_name');
+    $field_name = $this->randomMachineName() . '_field_name';
     $storage_definition = [
       'field_name' => $field_name,
       'entity_type' => 'taxonomy_term',
diff --git a/core/modules/taxonomy/tests/src/Traits/TaxonomyTestTrait.php b/core/modules/taxonomy/tests/src/Traits/TaxonomyTestTrait.php
index 60a4b771d112..4df0f1a29335 100644
--- a/core/modules/taxonomy/tests/src/Traits/TaxonomyTestTrait.php
+++ b/core/modules/taxonomy/tests/src/Traits/TaxonomyTestTrait.php
@@ -25,7 +25,7 @@ public function createVocabulary(array $values = []) {
     $values += [
       'name' => $this->randomMachineName(),
       'description' => $this->randomMachineName(),
-      'vid' => mb_strtolower($this->randomMachineName()),
+      'vid' => $this->randomMachineName(),
       'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
       'weight' => mt_rand(0, 10),
     ];
diff --git a/core/modules/text/tests/src/Functional/TextFieldTest.php b/core/modules/text/tests/src/Functional/TextFieldTest.php
index c62a9c8ede15..292e7d65273d 100644
--- a/core/modules/text/tests/src/Functional/TextFieldTest.php
+++ b/core/modules/text/tests/src/Functional/TextFieldTest.php
@@ -59,7 +59,7 @@ protected function setUp(): void {
   public function testTextFieldValidation() {
     // Create a field with settings to validate.
     $max_length = 3;
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
@@ -173,14 +173,14 @@ public function testTextfieldWidgetsAllowedFormats() {
     // Create one text format.
     $this->drupalLogin($this->adminUser);
     $format1 = FilterFormat::create([
-      'format' => mb_strtolower($this->randomMachineName()),
+      'format' => $this->randomMachineName(),
       'name' => '1_' . $this->randomMachineName(),
     ]);
     $format1->save();
 
     // Create a second text format.
     $format2 = FilterFormat::create([
-      'format' => mb_strtolower($this->randomMachineName()),
+      'format' => $this->randomMachineName(),
       'name' => '2_' . $this->randomMachineName(),
       'filters' => [
         'filter_html' => [
@@ -195,7 +195,7 @@ public function testTextfieldWidgetsAllowedFormats() {
 
     // Create a third text format.
     $format3 = FilterFormat::create([
-      'format' => mb_strtolower($this->randomMachineName()),
+      'format' => $this->randomMachineName(),
       'name' => '3_' . $this->randomMachineName(),
     ]);
     $format3->save();
@@ -210,7 +210,7 @@ public function testTextfieldWidgetsAllowedFormats() {
     ]);
 
     // Create a field with multiple formats allowed.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
@@ -307,7 +307,7 @@ public function testTextfieldWidgetsAllowedFormats() {
    */
   public function _testTextfieldWidgetsFormatted($field_type, $widget_type) {
     // Create a field.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'entity_test',
@@ -368,7 +368,7 @@ public function _testTextfieldWidgetsFormatted($field_type, $widget_type) {
     // access to it.
     $this->drupalLogin($this->adminUser);
     $edit = [
-      'format' => mb_strtolower($this->randomMachineName()),
+      'format' => $this->randomMachineName(),
       'name' => $this->randomMachineName(),
     ];
     $this->drupalGet('admin/config/content/formats/add');
diff --git a/core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php b/core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php
index 0867f962c95a..33487b9d60cd 100644
--- a/core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php
+++ b/core/modules/text/tests/src/FunctionalJavascript/TextareaWithSummaryTest.php
@@ -107,7 +107,7 @@ public function testTextSummaryRequiredBehavior() {
     $this->assertSummaryToggle();
 
     // Create a second field with a required summary.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_storage = FieldStorageConfig::create([
       'field_name' => $field_name,
       'entity_type' => 'node',
diff --git a/core/modules/text/tests/src/Kernel/TextItemBaseTest.php b/core/modules/text/tests/src/Kernel/TextItemBaseTest.php
index 38b26e38a6f2..d3c17673e0ca 100644
--- a/core/modules/text/tests/src/Kernel/TextItemBaseTest.php
+++ b/core/modules/text/tests/src/Kernel/TextItemBaseTest.php
@@ -70,7 +70,7 @@ public function testCalculateDependencies() {
       'name' => 'Test format',
     ]);
     $format->save();
-    $fieldName = mb_strtolower($this->randomMachineName());
+    $fieldName = $this->randomMachineName();
     $field_storage = FieldStorageConfig::create([
       'field_name' => $fieldName,
       'entity_type' => 'entity_test',
diff --git a/core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php b/core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php
index a82e53b9e1a4..784222d29919 100644
--- a/core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php
+++ b/core/modules/user/tests/src/Kernel/Condition/UserRoleConditionTest.php
@@ -71,7 +71,7 @@ protected function setUp(): void {
     ])->save();
 
     // Create new role.
-    $rid = strtolower($this->randomMachineName(8));
+    $rid = $this->randomMachineName(8);
     $label = $this->randomString(8);
     $role = Role::create([
       'id' => $rid,
diff --git a/core/modules/user/tests/src/Kernel/UserActionConfigSchemaTest.php b/core/modules/user/tests/src/Kernel/UserActionConfigSchemaTest.php
index 8767c92e1596..ca618b7f3b51 100644
--- a/core/modules/user/tests/src/Kernel/UserActionConfigSchemaTest.php
+++ b/core/modules/user/tests/src/Kernel/UserActionConfigSchemaTest.php
@@ -26,7 +26,7 @@ class UserActionConfigSchemaTest extends KernelTestBase {
    * Tests whether the user action config schema are valid.
    */
   public function testValidUserActionConfigSchema() {
-    $rid = strtolower($this->randomMachineName(8));
+    $rid = $this->randomMachineName(8);
     Role::create(['id' => $rid, 'label' => $rid])->save();
 
     // Test user_add_role_action configuration.
diff --git a/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php b/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php
index 696fc75193fc..8c696100d023 100644
--- a/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php
+++ b/core/modules/user/tests/src/Kernel/UserEntityReferenceTest.php
@@ -37,13 +37,13 @@ protected function setUp(): void {
     parent::setUp();
 
     $this->role1 = Role::create([
-      'id' => strtolower($this->randomMachineName(8)),
+      'id' => $this->randomMachineName(8),
       'label' => $this->randomMachineName(8),
     ]);
     $this->role1->save();
 
     $this->role2 = Role::create([
-      'id' => strtolower($this->randomMachineName(8)),
+      'id' => $this->randomMachineName(8),
       'label' => $this->randomMachineName(8),
     ]);
     $this->role2->save();
diff --git a/core/modules/user/tests/src/Kernel/UserRoleDeleteTest.php b/core/modules/user/tests/src/Kernel/UserRoleDeleteTest.php
index 7fa680f62ed0..024b69c9a21d 100644
--- a/core/modules/user/tests/src/Kernel/UserRoleDeleteTest.php
+++ b/core/modules/user/tests/src/Kernel/UserRoleDeleteTest.php
@@ -94,13 +94,13 @@ public function testDependenciesRemoval() {
 
     /** @var \Drupal\node\NodeTypeInterface $node_type */
     $node_type = NodeType::create([
-      'type' => mb_strtolower($this->randomMachineName()),
+      'type' => $this->randomMachineName(),
       'name' => $this->randomString(),
     ]);
     $node_type->save();
     // Create a new text format to be used by role $role.
     $format = FilterFormat::create([
-      'format' => mb_strtolower($this->randomMachineName()),
+      'format' => $this->randomMachineName(),
       'name' => $this->randomString(),
     ]);
     $format->save();
diff --git a/core/modules/user/tests/src/Traits/UserCreationTrait.php b/core/modules/user/tests/src/Traits/UserCreationTrait.php
index 753e5c38a4a3..85cde09eb17b 100644
--- a/core/modules/user/tests/src/Traits/UserCreationTrait.php
+++ b/core/modules/user/tests/src/Traits/UserCreationTrait.php
@@ -239,7 +239,7 @@ protected function createAdminRole($rid = NULL, $name = NULL, $weight = NULL) {
   protected function createRole(array $permissions, $rid = NULL, $name = NULL, $weight = NULL) {
     // Generate a random, lowercase machine name if none was passed.
     if (!isset($rid)) {
-      $rid = strtolower($this->randomMachineName(8));
+      $rid = $this->randomMachineName(8);
     }
     // Generate a random label.
     if (!isset($name)) {
diff --git a/core/modules/views/tests/src/Functional/DefaultViewsTest.php b/core/modules/views/tests/src/Functional/DefaultViewsTest.php
index 4717b3f24f59..d97f3256d54e 100644
--- a/core/modules/views/tests/src/Functional/DefaultViewsTest.php
+++ b/core/modules/views/tests/src/Functional/DefaultViewsTest.php
@@ -70,7 +70,7 @@ protected function setUp($import_test_views = TRUE, $modules = []): void {
     $vocabulary = Vocabulary::create([
       'name' => $this->randomMachineName(),
       'description' => $this->randomMachineName(),
-      'vid' => mb_strtolower($this->randomMachineName()),
+      'vid' => $this->randomMachineName(),
       'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
       'help' => '',
       'nodes' => ['page' => 'page'],
@@ -79,7 +79,7 @@ protected function setUp($import_test_views = TRUE, $modules = []): void {
     $vocabulary->save();
 
     // Create a field.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
 
     $handler_settings = [
       'target_bundles' => [
diff --git a/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php b/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php
index aa22353f1ed5..e49fda6d79ed 100644
--- a/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php
+++ b/core/modules/views/tests/src/Functional/Plugin/ExposedFormCheckboxesTest.php
@@ -127,7 +127,7 @@ public function testExposedIsAllOfFilter() {
     }
 
     // Create a field.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $handler_settings = [
       'target_bundles' => [
         $this->vocabulary->id() => $this->vocabulary->id(),
diff --git a/core/modules/views/tests/src/Functional/Wizard/BasicTest.php b/core/modules/views/tests/src/Functional/Wizard/BasicTest.php
index 61921c0c1681..120c4bcba1d6 100644
--- a/core/modules/views/tests/src/Functional/Wizard/BasicTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/BasicTest.php
@@ -38,7 +38,7 @@ public function testViewsWizardAndListing() {
     // Create a simple and not at all useful view.
     $view1 = [];
     $view1['label'] = $this->randomMachineName(16);
-    $view1['id'] = strtolower($this->randomMachineName(16));
+    $view1['id'] = $this->randomMachineName(16);
     $view1['description'] = $this->randomMachineName(16);
     $view1['page[create]'] = FALSE;
     $this->drupalGet('admin/structure/views/add');
@@ -65,7 +65,7 @@ public function testViewsWizardAndListing() {
     // Now create a page with simple node listing and an attached feed.
     $view2 = [];
     $view2['label'] = $this->randomMachineName(16);
-    $view2['id'] = strtolower($this->randomMachineName(16));
+    $view2['id'] = $this->randomMachineName(16);
     $view2['description'] = $this->randomMachineName(16);
     $view2['page[create]'] = 1;
     $view2['page[title]'] = $this->randomMachineName(16);
@@ -115,7 +115,7 @@ public function testViewsWizardAndListing() {
     // Create a view with a page and a block, and filter the listing.
     $view3 = [];
     $view3['label'] = $this->randomMachineName(16);
-    $view3['id'] = strtolower($this->randomMachineName(16));
+    $view3['id'] = $this->randomMachineName(16);
     $view3['description'] = $this->randomMachineName(16);
     $view3['show[wizard_key]'] = 'node';
     $view3['show[type]'] = 'page';
@@ -161,7 +161,7 @@ public function testViewsWizardAndListing() {
     // Create a view with only a REST export.
     $view4 = [];
     $view4['label'] = $this->randomMachineName(16);
-    $view4['id'] = strtolower($this->randomMachineName(16));
+    $view4['id'] = $this->randomMachineName(16);
     $view4['description'] = $this->randomMachineName(16);
     $view4['show[wizard_key]'] = 'node';
     $view4['show[type]'] = 'page';
@@ -184,7 +184,7 @@ public function testViewsWizardAndListing() {
     // set.
     $leading_slash_view = [];
     $leading_slash_view['label'] = $this->randomMachineName(16);
-    $leading_slash_view['id'] = strtolower($this->randomMachineName(16));
+    $leading_slash_view['id'] = $this->randomMachineName(16);
     $leading_slash_view['description'] = $this->randomMachineName(16);
     $leading_slash_view['show[wizard_key]'] = 'node';
     $leading_slash_view['show[type]'] = 'page';
@@ -202,7 +202,7 @@ public function testViewsWizardAndListing() {
    * @see \Drupal\views\Plugin\views\display\DisplayPluginBase::mergeDefaults()
    */
   public function testWizardDefaultValues() {
-    $random_id = strtolower($this->randomMachineName(16));
+    $random_id = $this->randomMachineName(16);
     // Create a basic view.
     $view = [];
     $view['label'] = $this->randomMachineName(16);
diff --git a/core/modules/views/tests/src/Functional/Wizard/EntityTestRevisionTest.php b/core/modules/views/tests/src/Functional/Wizard/EntityTestRevisionTest.php
index b0327bf2fba1..52de147919a8 100644
--- a/core/modules/views/tests/src/Functional/Wizard/EntityTestRevisionTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/EntityTestRevisionTest.php
@@ -30,7 +30,7 @@ public function testRevisionsViewWithNoTypeOnBaseTable() {
     $this->submitForm($type, 'Update "Show" choice');
     $view = [];
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['description'] = $this->randomMachineName(16);
     $view['page[create]'] = FALSE;
     $view['show[type]'] = 'entity_test_rev';
diff --git a/core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php b/core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php
index 61da043cf2df..67d3c38db83a 100644
--- a/core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/ItemsPerPageTest.php
@@ -44,7 +44,7 @@ public function testItemsPerPage() {
     // 3 in the block.
     $view = [];
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['description'] = $this->randomMachineName(16);
     $view['show[wizard_key]'] = 'node';
     $view['show[type]'] = 'article';
diff --git a/core/modules/views/tests/src/Functional/Wizard/MenuTest.php b/core/modules/views/tests/src/Functional/Wizard/MenuTest.php
index 616a12519ec6..74fc7dc212e8 100644
--- a/core/modules/views/tests/src/Functional/Wizard/MenuTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/MenuTest.php
@@ -26,7 +26,7 @@ public function testMenus() {
     // Create a view with a page display and a menu link in the Main Menu.
     $view = [];
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['description'] = $this->randomMachineName(16);
     $view['page[create]'] = 1;
     $view['page[title]'] = $this->randomMachineName(16);
diff --git a/core/modules/views/tests/src/Functional/Wizard/NodeWizardTest.php b/core/modules/views/tests/src/Functional/Wizard/NodeWizardTest.php
index bc2b2352f0c1..27924889afd7 100644
--- a/core/modules/views/tests/src/Functional/Wizard/NodeWizardTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/NodeWizardTest.php
@@ -23,7 +23,7 @@ public function testViewAddWithNodeTitles() {
 
     $view = [];
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['description'] = $this->randomMachineName(16);
     $view['page[create]'] = FALSE;
     $view['show[wizard_key]'] = 'node';
diff --git a/core/modules/views/tests/src/Functional/Wizard/PagerTest.php b/core/modules/views/tests/src/Functional/Wizard/PagerTest.php
index fb99faa53a8f..a3a3e34246c4 100644
--- a/core/modules/views/tests/src/Functional/Wizard/PagerTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/PagerTest.php
@@ -52,7 +52,7 @@ public function testPager() {
   protected function createViewAtPath($path, $pager = TRUE) {
     $view = [];
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['show[sort]'] = 'node_field_data-created:ASC';
     $view['page[create]'] = 1;
     $view['page[title]'] = $this->randomMachineName(16);
diff --git a/core/modules/views/tests/src/Functional/Wizard/SortingTest.php b/core/modules/views/tests/src/Functional/Wizard/SortingTest.php
index 52d8f96c2464..aa75f24139b3 100644
--- a/core/modules/views/tests/src/Functional/Wizard/SortingTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/SortingTest.php
@@ -37,7 +37,7 @@ public function testSorting() {
     // Create a view that sorts oldest first.
     $view1 = [];
     $view1['label'] = $this->randomMachineName(16);
-    $view1['id'] = strtolower($this->randomMachineName(16));
+    $view1['id'] = $this->randomMachineName(16);
     $view1['description'] = $this->randomMachineName(16);
     $view1['show[sort]'] = 'node_field_data-created:ASC';
     $view1['page[create]'] = 1;
@@ -64,7 +64,7 @@ public function testSorting() {
     // Create a view that sorts newest first.
     $view2 = [];
     $view2['label'] = $this->randomMachineName(16);
-    $view2['id'] = strtolower($this->randomMachineName(16));
+    $view2['id'] = $this->randomMachineName(16);
     $view2['description'] = $this->randomMachineName(16);
     $view2['show[sort]'] = 'node_field_data-created:DESC';
     $view2['page[create]'] = 1;
diff --git a/core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php b/core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php
index ffcdf1f49f0e..0319ef2d66a0 100644
--- a/core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php
+++ b/core/modules/views/tests/src/Functional/Wizard/TaggedWithTest.php
@@ -156,7 +156,7 @@ public function testTaggedWith() {
     $this->submitForm($view1, 'Update "of type" choice');
     // Now resubmit the entire form to the same URL.
     $view1['label'] = $this->randomMachineName(16);
-    $view1['id'] = strtolower($this->randomMachineName(16));
+    $view1['id'] = $this->randomMachineName(16);
     $view1['description'] = $this->randomMachineName(16);
     $view1['show[tagged_with]'] = 'tag1';
     $view1['page[create]'] = 1;
@@ -179,7 +179,7 @@ public function testTaggedWith() {
     $this->submitForm($view2, 'Update "of type" choice');
     $this->assertSession()->statusCodeEquals(200);
     $view2['label'] = $this->randomMachineName(16);
-    $view2['id'] = strtolower($this->randomMachineName(16));
+    $view2['id'] = $this->randomMachineName(16);
     $view2['description'] = $this->randomMachineName(16);
     $view2['show[tagged_with]'] = 'tag2';
     $view2['page[create]'] = 1;
diff --git a/core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php b/core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php
index dd248e217447..5e0a81ee3a44 100644
--- a/core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php
+++ b/core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php
@@ -62,7 +62,7 @@ protected function setUp($import_test_views = TRUE): void {
     ]);
     $content_type->save();
     $field_storage = FieldStorageConfig::create([
-      'field_name' => mb_strtolower($this->randomMachineName()),
+      'field_name' => $this->randomMachineName(),
       'entity_type' => 'node',
       'type' => 'comment',
     ]);
diff --git a/core/modules/views/tests/src/Kernel/Plugin/BlockDependenciesTest.php b/core/modules/views/tests/src/Kernel/Plugin/BlockDependenciesTest.php
index d3930d35c0f8..713981a19fa0 100644
--- a/core/modules/views/tests/src/Kernel/Plugin/BlockDependenciesTest.php
+++ b/core/modules/views/tests/src/Kernel/Plugin/BlockDependenciesTest.php
@@ -94,7 +94,7 @@ protected function createBlock($plugin_id, array $settings = []) {
     $settings += [
       'plugin' => $plugin_id,
       'region' => 'sidebar_first',
-      'id' => strtolower($this->randomMachineName(8)),
+      'id' => $this->randomMachineName(8),
       'theme' => $this->config('system.theme')->get('default'),
       'label' => $this->randomMachineName(8),
       'visibility' => [],
diff --git a/core/modules/views/tests/src/Kernel/Wizard/WizardPluginBaseKernelTest.php b/core/modules/views/tests/src/Kernel/Wizard/WizardPluginBaseKernelTest.php
index 81c596e06247..21d09d521930 100644
--- a/core/modules/views/tests/src/Kernel/Wizard/WizardPluginBaseKernelTest.php
+++ b/core/modules/views/tests/src/Kernel/Wizard/WizardPluginBaseKernelTest.php
@@ -49,7 +49,7 @@ public function testCreateView() {
     $form = [];
     $form_state = new FormState();
     $form = $this->wizard->buildForm($form, $form_state);
-    $random_id = strtolower($this->randomMachineName());
+    $random_id = $this->randomMachineName();
     $random_label = $this->randomMachineName();
     $random_description = $this->randomMachineName();
 
diff --git a/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php b/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php
index 7d13dbbc83e6..af2b56863e05 100644
--- a/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DefaultViewsTest.php
@@ -107,7 +107,7 @@ public function testDefaultViews() {
     // Duplicate a view and set a custom name.
     $this->drupalGet('admin/structure/views');
     $this->clickViewsOperationLink('Duplicate', '/glossary');
-    $random_name = strtolower($this->randomMachineName());
+    $random_name = $this->randomMachineName();
     $this->submitForm(['id' => $random_name], 'Duplicate');
     $this->assertSession()->addressEquals("admin/structure/views/view/$random_name");
 
diff --git a/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php b/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php
index eee32d0c7574..43c7f212143f 100644
--- a/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DisplayPathTest.php
@@ -238,7 +238,7 @@ public function testDefaultMenuTabRegression() {
 
     $edit = [];
     $edit['label'] = $this->randomMachineName(16);
-    $view_id = $edit['id'] = strtolower($this->randomMachineName(16));
+    $view_id = $edit['id'] = $this->randomMachineName(16);
     $edit['description'] = $this->randomMachineName(16);
     $edit['page[create]'] = TRUE;
     $edit['page[path]'] = 'admin/foo';
diff --git a/core/modules/views_ui/tests/src/Functional/DuplicateTest.php b/core/modules/views_ui/tests/src/Functional/DuplicateTest.php
index 1b17ab4a1358..bdddf15b0fc8 100644
--- a/core/modules/views_ui/tests/src/Functional/DuplicateTest.php
+++ b/core/modules/views_ui/tests/src/Functional/DuplicateTest.php
@@ -36,7 +36,7 @@ public function testDuplicateView() {
 
     // Generate random label and id for new view.
     $view['label'] = $this->randomMachineName(255);
-    $view['id'] = strtolower($this->randomMachineName(128));
+    $view['id'] = $this->randomMachineName(128);
 
     // Duplicate view.
     $this->drupalGet('admin/structure/views/view/' . $random_view['id'] . '/duplicate');
diff --git a/core/modules/views_ui/tests/src/Functional/FieldUITest.php b/core/modules/views_ui/tests/src/Functional/FieldUITest.php
index 02a309048d44..283994202d2a 100644
--- a/core/modules/views_ui/tests/src/Functional/FieldUITest.php
+++ b/core/modules/views_ui/tests/src/Functional/FieldUITest.php
@@ -87,7 +87,7 @@ public function testFieldLabel() {
     // labels by default.
     $view = [];
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['description'] = $this->randomMachineName(16);
     $view['show[wizard_key]'] = 'node';
     $view['page[create]'] = TRUE;
diff --git a/core/modules/views_ui/tests/src/Functional/NewViewConfigSchemaTest.php b/core/modules/views_ui/tests/src/Functional/NewViewConfigSchemaTest.php
index 535afb26259c..00923356db31 100644
--- a/core/modules/views_ui/tests/src/Functional/NewViewConfigSchemaTest.php
+++ b/core/modules/views_ui/tests/src/Functional/NewViewConfigSchemaTest.php
@@ -48,7 +48,7 @@ public function testNewViews() {
     foreach ($wizards as $wizard_key) {
       $edit = [];
       $edit['label'] = $this->randomString();
-      $edit['id'] = strtolower($this->randomMachineName());
+      $edit['id'] = $this->randomMachineName();
       $edit['show[wizard_key]'] = $wizard_key;
       $edit['description'] = $this->randomString();
       $this->drupalGet('admin/structure/views/add');
diff --git a/core/modules/views_ui/tests/src/Functional/OverrideDisplaysTest.php b/core/modules/views_ui/tests/src/Functional/OverrideDisplaysTest.php
index 1c030b5cdcde..2dac1a7d1c2a 100644
--- a/core/modules/views_ui/tests/src/Functional/OverrideDisplaysTest.php
+++ b/core/modules/views_ui/tests/src/Functional/OverrideDisplaysTest.php
@@ -30,7 +30,7 @@ public function testOverrideDisplays() {
     // Create a basic view that shows all content, with a page and a block
     // display.
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['page[create]'] = 1;
     $view['page[path]'] = $this->randomMachineName(16);
     $view['block[create]'] = 1;
@@ -96,7 +96,7 @@ public function testWizardMixedDefaultOverriddenDisplays() {
     // page and feed to inherit their titles from the default display, but the
     // block to override it.
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['page[create]'] = 1;
     $view['page[title]'] = $this->randomMachineName(16);
     $view['page[path]'] = $this->randomMachineName(16);
@@ -195,7 +195,7 @@ public function testRevertAllDisplays() {
     // Because there is both a title on page and block we expect the title on
     // the block be overridden.
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['page[create]'] = 1;
     $view['page[title]'] = $this->randomMachineName(16);
     $view['page[path]'] = $this->randomMachineName(16);
diff --git a/core/modules/views_ui/tests/src/Functional/PreviewTest.php b/core/modules/views_ui/tests/src/Functional/PreviewTest.php
index 7dc135a9be1d..c8c6728df356 100644
--- a/core/modules/views_ui/tests/src/Functional/PreviewTest.php
+++ b/core/modules/views_ui/tests/src/Functional/PreviewTest.php
@@ -91,7 +91,7 @@ public function testPreviewUI() {
     // Test feed preview.
     $view = [];
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['page[create]'] = 1;
     $view['page[title]'] = $this->randomMachineName(16);
     $view['page[path]'] = $this->randomMachineName(16);
diff --git a/core/modules/views_ui/tests/src/Functional/SettingsTest.php b/core/modules/views_ui/tests/src/Functional/SettingsTest.php
index c04475bd6ae5..7535c380db81 100644
--- a/core/modules/views_ui/tests/src/Functional/SettingsTest.php
+++ b/core/modules/views_ui/tests/src/Functional/SettingsTest.php
@@ -55,7 +55,7 @@ public function testEditUI() {
 
     $view = [];
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['description'] = $this->randomMachineName(16);
     $view['page[create]'] = TRUE;
     $view['page[title]'] = $this->randomMachineName(16);
@@ -78,7 +78,7 @@ public function testEditUI() {
 
     // Create a view with an additional display, so default should be hidden.
     $view['page[create]'] = TRUE;
-    $view['id'] = strtolower($this->randomMachineName());
+    $view['id'] = $this->randomMachineName();
     $this->drupalGet('admin/structure/views/add');
     $this->submitForm($view, 'Save and edit');
 
@@ -94,7 +94,7 @@ public function testEditUI() {
     $this->drupalGet('admin/structure/views/settings');
     $this->submitForm($edit, 'Save configuration');
 
-    $view['id'] = strtolower($this->randomMachineName());
+    $view['id'] = $this->randomMachineName();
     $this->drupalGet('admin/structure/views/add');
     $this->submitForm($view, 'Save and edit');
     $this->assertSession()->buttonExists('edit-displays-top-add-display-embed');
@@ -116,7 +116,7 @@ public function testEditUI() {
     $this->drupalGet('admin/structure/views/settings');
     $this->submitForm($edit, 'Save configuration');
 
-    $view['id'] = strtolower($this->randomMachineName());
+    $view['id'] = $this->randomMachineName();
     $this->drupalGet('admin/structure/views/add');
     $this->submitForm($view, 'Save and edit');
 
@@ -130,7 +130,7 @@ public function testEditUI() {
     $this->drupalGet('admin/structure/views/settings');
     $this->submitForm($edit, 'Save configuration');
 
-    $view['id'] = strtolower($this->randomMachineName());
+    $view['id'] = $this->randomMachineName();
     $this->drupalGet('admin/structure/views/add');
     $this->submitForm($view, 'Save and edit');
 
diff --git a/core/modules/views_ui/tests/src/Functional/StyleTableTest.php b/core/modules/views_ui/tests/src/Functional/StyleTableTest.php
index b2ecd1d286ad..456ec51821d3 100644
--- a/core/modules/views_ui/tests/src/Functional/StyleTableTest.php
+++ b/core/modules/views_ui/tests/src/Functional/StyleTableTest.php
@@ -24,7 +24,7 @@ public function testWizard() {
     // Create a new view and check that the first field has a label.
     $view = [];
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['show[wizard_key]'] = 'node';
     $view['page[create]'] = TRUE;
     $view['page[style][style_plugin]'] = 'table';
diff --git a/core/modules/views_ui/tests/src/Functional/UITestBase.php b/core/modules/views_ui/tests/src/Functional/UITestBase.php
index deb140595b8a..ef4aae78065b 100644
--- a/core/modules/views_ui/tests/src/Functional/UITestBase.php
+++ b/core/modules/views_ui/tests/src/Functional/UITestBase.php
@@ -57,7 +57,7 @@ public function randomView(array $view = []) {
     // Create a new view in the UI.
     $default = [];
     $default['label'] = $this->randomMachineName(16);
-    $default['id'] = strtolower($this->randomMachineName(16));
+    $default['id'] = $this->randomMachineName(16);
     $default['description'] = $this->randomMachineName(16);
     $default['page[create]'] = TRUE;
     $default['page[path]'] = $default['id'];
diff --git a/core/modules/views_ui/tests/src/Functional/ViewsUITourTest.php b/core/modules/views_ui/tests/src/Functional/ViewsUITourTest.php
index c28580b32cbf..eea297a2b71e 100644
--- a/core/modules/views_ui/tests/src/Functional/ViewsUITourTest.php
+++ b/core/modules/views_ui/tests/src/Functional/ViewsUITourTest.php
@@ -57,7 +57,7 @@ public function testViewsUiTourTips() {
     // Create a basic view that shows all content, with a page and a block
     // display.
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['page[create]'] = 1;
     $view['page[path]'] = $this->randomMachineName(16);
     $this->drupalGet('admin/structure/views/add');
@@ -97,7 +97,7 @@ public function testViewsUiTourTipsTranslated() {
     // Create a basic view that shows all content, with a page and a block
     // display.
     $view['label'] = $this->randomMachineName(16);
-    $view['id'] = strtolower($this->randomMachineName(16));
+    $view['id'] = $this->randomMachineName(16);
     $view['page[create]'] = 1;
     $view['page[path]'] = $this->randomMachineName(16);
     // Load the page in dutch.
diff --git a/core/modules/views_ui/tests/src/Functional/WizardTest.php b/core/modules/views_ui/tests/src/Functional/WizardTest.php
index 55f1967bafdc..81718fd21c46 100644
--- a/core/modules/views_ui/tests/src/Functional/WizardTest.php
+++ b/core/modules/views_ui/tests/src/Functional/WizardTest.php
@@ -25,7 +25,7 @@ class WizardTest extends WizardTestBase {
   public function testWizardFieldLength() {
     $view = [];
     $view['label'] = $this->randomMachineName(256);
-    $view['id'] = strtolower($this->randomMachineName(129));
+    $view['id'] = $this->randomMachineName(129);
     $view['page[create]'] = TRUE;
     $view['page[path]'] = $this->randomMachineName(255);
     $view['page[title]'] = $this->randomMachineName(256);
@@ -48,7 +48,7 @@ public function testWizardFieldLength() {
     $this->assertSession()->pageTextContains('REST export path cannot be longer than 254 characters but is currently 255 characters long.');
 
     $view['label'] = $this->randomMachineName(255);
-    $view['id'] = strtolower($this->randomMachineName(128));
+    $view['id'] = $this->randomMachineName(128);
     $view['page[create]'] = TRUE;
     $view['page[path]'] = $this->randomMachineName(254);
     $view['page[title]'] = $this->randomMachineName(255);
diff --git a/core/modules/workspaces/tests/src/Functional/WorkspaceTest.php b/core/modules/workspaces/tests/src/Functional/WorkspaceTest.php
index 4e9d012bf0ca..f8080e8f76a9 100644
--- a/core/modules/workspaces/tests/src/Functional/WorkspaceTest.php
+++ b/core/modules/workspaces/tests/src/Functional/WorkspaceTest.php
@@ -226,7 +226,7 @@ public function testWorkspaceFieldUi() {
     $this->assertSession()->statusCodeEquals(200);
 
     // Create a new filed.
-    $field_name = mb_strtolower($this->randomMachineName());
+    $field_name = $this->randomMachineName();
     $field_label = $this->randomMachineName();
     $this->fieldUIAddNewField('admin/config/workflow/workspaces', $field_name, $field_label, 'string');
 
diff --git a/core/modules/workspaces/tests/src/Kernel/WorkspaceViewsKernelTest.php b/core/modules/workspaces/tests/src/Kernel/WorkspaceViewsKernelTest.php
index b34a23661d0b..8cc6f1755800 100644
--- a/core/modules/workspaces/tests/src/Kernel/WorkspaceViewsKernelTest.php
+++ b/core/modules/workspaces/tests/src/Kernel/WorkspaceViewsKernelTest.php
@@ -32,7 +32,7 @@ public function testCreateWorkspaceView() {
     $form = [];
     $form_state = new FormState();
     $form = $wizard->buildForm($form, $form_state);
-    $random_id = strtolower($this->randomMachineName());
+    $random_id = $this->randomMachineName();
     $random_label = $this->randomMachineName();
 
     $form_state->setValues([
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStatusTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStatusTest.php
index 044b9eb4ae1a..61c9d2e2f698 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStatusTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityStatusTest.php
@@ -23,7 +23,7 @@ class ConfigEntityStatusTest extends KernelTestBase {
    */
   public function testCRUD() {
     $entity = \Drupal::entityTypeManager()->getStorage('config_test')->create([
-      'id' => strtolower($this->randomMachineName()),
+      'id' => $this->randomMachineName(),
     ]);
     $this->assertTrue($entity->status(), 'Default status is enabled.');
     $entity->save();
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityValidationTestBase.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityValidationTestBase.php
index aeed2a6737ce..1f3c8928f8fb 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityValidationTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigEntityValidationTestBase.php
@@ -154,7 +154,7 @@ public function testMachineNameLength(): void {
     $id_key = $this->entity->getEntityType()->getKey('id');
     $this->entity->set(
       $id_key,
-      mb_strtolower($this->randomMachineName($max_length + 2))
+      $this->randomMachineName($max_length + 2)
     );
     $this->assertValidationErrors([
       $id_key => 'This value is too long. It should have <em class="placeholder">' . $max_length . '</em> characters or less.',
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRecreateTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRecreateTest.php
index c65a9004b8ce..c26c80c1d58f 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRecreateTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRecreateTest.php
@@ -60,7 +60,7 @@ protected function setUp(): void {
   }
 
   public function testRecreateEntity() {
-    $type_name = mb_strtolower($this->randomMachineName(16));
+    $type_name = $this->randomMachineName(16);
     $content_type = NodeType::create([
       'type' => $type_name,
       'name' => 'Node type one',
diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php
index 5dffd1c93d64..72ed6cda2bf8 100644
--- a/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigImportRenameValidationTest.php
@@ -89,7 +89,7 @@ public function testRenameValidation() {
 
     // Create a content type with a matching UUID in the active storage.
     $content_type = NodeType::create([
-      'type' => mb_strtolower($this->randomMachineName(16)),
+      'type' => $this->randomMachineName(16),
       'name' => $this->randomMachineName(),
       'uuid' => $uuid,
     ]);
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityLanguageTestBase.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityLanguageTestBase.php
index 6066118ff77f..0668c8ac190f 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityLanguageTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityLanguageTestBase.php
@@ -66,10 +66,10 @@ protected function setUp(): void {
     $this->state->set('entity_test.translation', TRUE);
 
     // Create a translatable test field.
-    $this->fieldName = mb_strtolower($this->randomMachineName() . '_field_name');
+    $this->fieldName = $this->randomMachineName() . '_field_name';
 
     // Create an untranslatable test field.
-    $this->untranslatableFieldName = mb_strtolower($this->randomMachineName() . '_field_name');
+    $this->untranslatableFieldName = $this->randomMachineName() . '_field_name';
 
     // Create field fields in all entity variations.
     foreach (entity_test_entity_types() as $entity_type) {
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php
index 036c453186c1..84de113342e6 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryRelationshipTest.php
@@ -70,13 +70,13 @@ protected function setUp(): void {
     // We want an entity reference field. It needs a vocabulary, terms, a field
     // storage and a field. First, create the vocabulary.
     $vocabulary = Vocabulary::create([
-      'vid' => mb_strtolower($this->randomMachineName()),
+      'vid' => $this->randomMachineName(),
     ]);
     $vocabulary->save();
 
     // Second, create the field.
     entity_test_create_bundle('test_bundle');
-    $this->fieldName = strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
     $handler_settings = [
       'target_bundles' => [
         $vocabulary->id() => $vocabulary->id(),
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php
index 66d650fad00c..95d8c6a8eddd 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php
@@ -73,8 +73,8 @@ protected function setUp(): void {
 
     $this->installConfig(['language']);
 
-    $figures = mb_strtolower($this->randomMachineName());
-    $greetings = mb_strtolower($this->randomMachineName());
+    $figures = $this->randomMachineName();
+    $greetings = $this->randomMachineName();
     foreach ([$figures => 'shape', $greetings => 'text'] as $field_name => $field_type) {
       $field_storage = FieldStorageConfig::create([
         'field_name' => $field_name,
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/FieldSqlStorageTest.php b/core/tests/Drupal/KernelTests/Core/Entity/FieldSqlStorageTest.php
index 6d3ac67e9178..3c938e5db30a 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/FieldSqlStorageTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/FieldSqlStorageTest.php
@@ -80,7 +80,7 @@ protected function setUp(): void {
     $this->installEntitySchema('entity_test_rev');
     $entity_type = 'entity_test_rev';
 
-    $this->fieldName = strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
     $this->fieldCardinality = 4;
     $this->fieldStorage = FieldStorageConfig::create([
       'field_name' => $this->fieldName,
@@ -283,7 +283,7 @@ public function testLongNames() {
     $storage = $this->container->get('entity_type.manager')->getStorage($entity_type);
 
     // Create two fields and generate random values.
-    $name_base = mb_strtolower($this->randomMachineName(FieldStorageConfig::NAME_MAX_LENGTH - 1));
+    $name_base = $this->randomMachineName(FieldStorageConfig::NAME_MAX_LENGTH - 1);
     $field_names = [];
     $values = [];
     for ($i = 0; $i < 2; $i++) {
diff --git a/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php b/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php
index 7eb64d6f3808..3ce62f243d0d 100644
--- a/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Field/FieldItemTest.php
@@ -32,7 +32,7 @@ protected function setUp(): void {
     $entity_type_id = 'entity_test_mulrev';
     $this->installEntitySchema($entity_type_id);
 
-    $this->fieldName = mb_strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
 
     /** @var \Drupal\field\Entity\FieldStorageConfig $field_storage */
     FieldStorageConfig::create([
diff --git a/core/tests/Drupal/KernelTests/Core/Field/FieldMissingTypeTest.php b/core/tests/Drupal/KernelTests/Core/Field/FieldMissingTypeTest.php
index f6550027f38c..5a725bed81a3 100644
--- a/core/tests/Drupal/KernelTests/Core/Field/FieldMissingTypeTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Field/FieldMissingTypeTest.php
@@ -37,7 +37,7 @@ protected function setUp(): void {
 
     $entity_type_id = 'entity_test_mulrev';
     $this->installEntitySchema($entity_type_id);
-    $this->fieldName = mb_strtolower($this->randomMachineName());
+    $this->fieldName = $this->randomMachineName();
 
     /** @var \Drupal\field\Entity\FieldStorageConfig $field_storage */
     FieldStorageConfig::create([
diff --git a/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php b/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php
index 3a651d0a88bc..8b51ed22c32d 100644
--- a/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php
@@ -505,7 +505,7 @@ public function testLifecycleLink($lifecycle, $lifecycle_link = NULL, $exception
     vfsStream::setup('modules');
     // Use a random file name to bypass the static caching in
     // \Drupal\Core\Extension\InfoParser.
-    $random = mb_strtolower($this->randomMachineName());
+    $random = $this->randomMachineName();
     $filename = "lifecycle-$random.info.yml";
     vfsStream::create([
       'fixtures' => [
-- 
GitLab