Issue #3376281 by Indrapatil, nlisgo, longwave, smustgrave: Random machine names no longer need to be wrapped in strtolower()
parent
a9199caf7c
commit
b175481f32
|
@ -44,7 +44,7 @@ class BlockHookOperationTest extends BrowserTestBase {
|
|||
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.
|
||||
|
|
|
@ -79,7 +79,7 @@ class BlockLanguageTest extends BrowserTestBase {
|
|||
// 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 @@ class BlockLanguageTest extends BrowserTestBase {
|
|||
$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,
|
||||
|
|
|
@ -30,7 +30,7 @@ class BlockTest extends BlockTestBase {
|
|||
// 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 @@ class BlockTest extends BlockTestBase {
|
|||
// 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 @@ class BlockTest extends BlockTestBase {
|
|||
// 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 @@ class BlockTest extends BlockTestBase {
|
|||
|
||||
// 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 @@ class BlockTest extends BlockTestBase {
|
|||
$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 @@ class BlockTest extends BlockTestBase {
|
|||
$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 = [
|
||||
|
|
|
@ -317,7 +317,7 @@ class BlockUiTest extends BrowserTestBase {
|
|||
|
||||
// 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';
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ class DisplayBlockTest extends ViewTestBase {
|
|||
// 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;
|
||||
|
|
|
@ -65,7 +65,7 @@ class BlockConfigSchemaTest extends KernelTestBase {
|
|||
*/
|
||||
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',
|
||||
|
|
|
@ -35,15 +35,15 @@ class NewDefaultThemeBlocksTest extends KernelTestBase {
|
|||
|
||||
// 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.
|
||||
|
|
|
@ -43,7 +43,7 @@ trait BlockCreationTrait {
|
|||
$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' => [],
|
||||
|
|
|
@ -108,7 +108,7 @@ abstract class BlockContentTestBase extends BrowserTestBase {
|
|||
if (is_array($values)) {
|
||||
if (!isset($values['id'])) {
|
||||
do {
|
||||
$id = strtolower($this->randomMachineName(8));
|
||||
$id = $this->randomMachineName(8);
|
||||
} while (BlockContentType::load($id));
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -88,7 +88,7 @@ class BlockContentTranslationUITest extends ContentTranslationUITestBase {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getNewEntityValues($langcode) {
|
||||
return ['info' => mb_strtolower($this->randomMachineName())] + parent::getNewEntityValues($langcode);
|
||||
return ['info' => $this->randomMachineName()] + parent::getNewEntityValues($langcode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -39,7 +39,7 @@ class PageEditTest extends BlockContentTestBase {
|
|||
$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');
|
||||
|
|
|
@ -88,7 +88,7 @@ abstract class BlockContentTestBase extends ViewTestBase {
|
|||
// 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 {
|
||||
|
|
|
@ -35,7 +35,7 @@ class BlockContentWizardTest extends BlockContentTestBase {
|
|||
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';
|
||||
|
|
|
@ -309,7 +309,7 @@ class CommentInterfaceTest extends CommentTestBase {
|
|||
$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",
|
||||
|
|
|
@ -44,7 +44,7 @@ class WizardTest extends WizardTestBase {
|
|||
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 @@ class WizardTest extends WizardTestBase {
|
|||
}
|
||||
$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.
|
||||
|
|
|
@ -58,7 +58,7 @@ class CommentIntegrationTest extends KernelTestBase {
|
|||
* @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 @@ class CommentIntegrationTest extends KernelTestBase {
|
|||
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',
|
||||
],
|
||||
|
|
|
@ -31,7 +31,7 @@ class ConfigEntityStatusUITest extends BrowserTestBase {
|
|||
'administer site configuration',
|
||||
]));
|
||||
|
||||
$id = strtolower($this->randomMachineName());
|
||||
$id = $this->randomMachineName();
|
||||
$edit = [
|
||||
'id' => $id,
|
||||
'label' => $this->randomMachineName(),
|
||||
|
|
|
@ -230,7 +230,7 @@ class ConfigEntityTest extends BrowserTestBase {
|
|||
'administer site configuration',
|
||||
]));
|
||||
|
||||
$id = strtolower($this->randomMachineName());
|
||||
$id = $this->randomMachineName();
|
||||
$label1 = $this->randomMachineName();
|
||||
$label2 = $this->randomMachineName();
|
||||
$label3 = $this->randomMachineName();
|
||||
|
@ -290,7 +290,7 @@ class ConfigEntityTest extends BrowserTestBase {
|
|||
|
||||
// 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 @@ class ConfigEntityTest extends BrowserTestBase {
|
|||
// @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(),
|
||||
|
|
|
@ -106,7 +106,7 @@ class ConfigExportImportUITest extends BrowserTestBase {
|
|||
$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',
|
||||
|
|
|
@ -122,7 +122,7 @@ class ConfigTranslationCacheTest extends BrowserTestBase {
|
|||
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 @@ class ConfigTranslationCacheTest extends BrowserTestBase {
|
|||
$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,
|
||||
|
|
|
@ -104,7 +104,7 @@ class ConfigTranslationListUiTest extends BrowserTestBase {
|
|||
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 @@ class ConfigTranslationListUiTest extends BrowserTestBase {
|
|||
// 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 @@ class ConfigTranslationListUiTest extends BrowserTestBase {
|
|||
$vocabulary = Vocabulary::create([
|
||||
'name' => $this->randomMachineName(),
|
||||
'description' => $this->randomMachineName(),
|
||||
'vid' => mb_strtolower($this->randomMachineName()),
|
||||
'vid' => $this->randomMachineName(),
|
||||
]);
|
||||
$vocabulary->save();
|
||||
|
||||
|
@ -199,7 +199,7 @@ class ConfigTranslationListUiTest extends BrowserTestBase {
|
|||
// 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 @@ class ConfigTranslationListUiTest extends BrowserTestBase {
|
|||
// 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 @@ class ConfigTranslationListUiTest extends BrowserTestBase {
|
|||
// 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 @@ class ConfigTranslationListUiTest extends BrowserTestBase {
|
|||
// 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 @@ class ConfigTranslationListUiTest extends BrowserTestBase {
|
|||
// 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 @@ class ConfigTranslationListUiTest extends BrowserTestBase {
|
|||
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 @@ class ConfigTranslationListUiTest extends BrowserTestBase {
|
|||
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(),
|
||||
]);
|
||||
|
||||
|
|
|
@ -746,7 +746,7 @@ class ConfigTranslationUiTest extends BrowserTestBase {
|
|||
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 @@ class ConfigTranslationUiTest extends BrowserTestBase {
|
|||
$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 @@ class ConfigTranslationUiTest extends BrowserTestBase {
|
|||
*/
|
||||
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,
|
||||
|
|
|
@ -163,16 +163,16 @@ class ContactSitewideTest extends BrowserTestBase {
|
|||
$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 @@ class ContactSitewideTest extends BrowserTestBase {
|
|||
$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 @@ class ContactSitewideTest extends BrowserTestBase {
|
|||
|
||||
$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 @@ class ContactSitewideTest extends BrowserTestBase {
|
|||
$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;
|
||||
|
|
|
@ -51,7 +51,7 @@ class ContactStorageTest extends ContactSitewideTest {
|
|||
$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.');
|
||||
|
|
|
@ -34,7 +34,7 @@ class ContactFieldsTest extends KernelTestBase {
|
|||
FieldStorageConfig::create([
|
||||
'type' => 'text',
|
||||
'entity_type' => 'contact_message',
|
||||
'field_name' => $field_name = strtolower($this->randomMachineName()),
|
||||
'field_name' => $field_name = $this->randomMachineName(),
|
||||
])->save();
|
||||
|
||||
ContactForm::create([
|
||||
|
|
|
@ -114,8 +114,8 @@ abstract class DateTestBase extends BrowserTestBase {
|
|||
* 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';
|
||||
|
||||
|
|
|
@ -688,7 +688,7 @@ class DateTimeFieldTest extends DateTestBase {
|
|||
$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 @@ class DateTimeFieldTest extends DateTestBase {
|
|||
$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',
|
||||
|
|
|
@ -1000,7 +1000,7 @@ class DateRangeFieldTest extends DateTestBase {
|
|||
$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 @@ class DateRangeFieldTest extends DateTestBase {
|
|||
$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',
|
||||
|
|
|
@ -46,7 +46,7 @@ class DateRangeItemTest extends FieldKernelTestBase {
|
|||
|
||||
// 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],
|
||||
|
|
|
@ -57,7 +57,7 @@ class SeparatorTranslationTest extends KernelTestBase {
|
|||
|
||||
// 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],
|
||||
|
|
|
@ -116,7 +116,7 @@ class EditorAdminTest extends BrowserTestBase {
|
|||
$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());
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -68,7 +68,7 @@ class BooleanFieldTest extends BrowserTestBase {
|
|||
$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',
|
||||
|
|
|
@ -46,7 +46,7 @@ class BooleanFormatterSettingsTest extends BrowserTestBase {
|
|||
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 @@ class BooleanFormatterSettingsTest extends BrowserTestBase {
|
|||
]);
|
||||
$this->drupalLogin($admin_user);
|
||||
|
||||
$this->fieldName = mb_strtolower($this->randomMachineName(8));
|
||||
$this->fieldName = $this->randomMachineName(8);
|
||||
|
||||
$field_storage = FieldStorageConfig::create([
|
||||
'field_name' => $this->fieldName,
|
||||
|
|
|
@ -58,7 +58,7 @@ class EmailFieldTest extends BrowserTestBase {
|
|||
*/
|
||||
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',
|
||||
|
|
|
@ -57,7 +57,7 @@ class EntityReferenceAdminTest extends BrowserTestBase {
|
|||
$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 @@ class EntityReferenceAdminTest extends BrowserTestBase {
|
|||
/** @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 @@ class EntityReferenceAdminTest extends BrowserTestBase {
|
|||
$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;
|
||||
|
|
|
@ -162,7 +162,7 @@ class EntityReferenceAutoCreateTest extends BrowserTestBase {
|
|||
/** @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 @@ class EntityReferenceAutoCreateTest extends BrowserTestBase {
|
|||
// 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 @@ class EntityReferenceAutoCreateTest extends BrowserTestBase {
|
|||
]);
|
||||
$this->drupalLogin($account);
|
||||
|
||||
$field_name = mb_strtolower($this->randomMachineName());
|
||||
$field_name = $this->randomMachineName();
|
||||
$handler_settings = [
|
||||
'auto_create' => TRUE,
|
||||
];
|
||||
|
|
|
@ -64,7 +64,7 @@ class EntityReferenceFieldDefaultValueTest extends BrowserTestBase {
|
|||
// 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 @@ class EntityReferenceFieldDefaultValueTest extends BrowserTestBase {
|
|||
$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',
|
||||
|
|
|
@ -63,7 +63,7 @@ class StringFieldTest extends BrowserTestBase {
|
|||
*/
|
||||
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',
|
||||
|
|
|
@ -47,7 +47,7 @@ class NumberFieldTest extends BrowserTestBase {
|
|||
*/
|
||||
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 @@ class NumberFieldTest extends BrowserTestBase {
|
|||
$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 @@ class NumberFieldTest extends BrowserTestBase {
|
|||
*/
|
||||
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 @@ class NumberFieldTest extends BrowserTestBase {
|
|||
*/
|
||||
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 @@ class NumberFieldTest extends BrowserTestBase {
|
|||
*/
|
||||
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',
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -46,7 +46,7 @@ class BooleanFormatterSettingsTest extends WebDriverTestBase {
|
|||
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 @@ class BooleanFormatterSettingsTest extends WebDriverTestBase {
|
|||
]);
|
||||
$this->drupalLogin($admin_user);
|
||||
|
||||
$this->fieldName = mb_strtolower($this->randomMachineName(8));
|
||||
$this->fieldName = $this->randomMachineName(8);
|
||||
|
||||
$field_storage = FieldStorageConfig::create([
|
||||
'field_name' => $this->fieldName,
|
||||
|
|
|
@ -65,12 +65,12 @@ class EntityReferenceAdminTest extends WebDriverTestBase {
|
|||
$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();
|
||||
|
||||
|
|
|
@ -45,9 +45,9 @@ class NumberFieldTest extends WebDriverTestBase {
|
|||
* 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();
|
||||
|
|
|
@ -60,7 +60,7 @@ class BooleanFormatterTest extends KernelTestBase {
|
|||
|
||||
$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,
|
||||
|
|
|
@ -88,7 +88,7 @@ class EntityReferenceItemTest extends FieldKernelTestBase {
|
|||
|
||||
$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 @@ class EntityReferenceItemTest extends FieldKernelTestBase {
|
|||
// 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 @@ class EntityReferenceItemTest extends FieldKernelTestBase {
|
|||
* 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',
|
||||
|
|
|
@ -72,13 +72,13 @@ class EntityReferenceSettingsTest extends KernelTestBase {
|
|||
$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 @@ class EntityReferenceSettingsTest extends KernelTestBase {
|
|||
/** @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 @@ class EntityReferenceSettingsTest extends KernelTestBase {
|
|||
$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 @@ class EntityReferenceSettingsTest extends KernelTestBase {
|
|||
*/
|
||||
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);
|
||||
|
|
|
@ -60,7 +60,7 @@ class SelectionTest extends KernelTestBase {
|
|||
$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]);
|
||||
|
|
|
@ -294,7 +294,7 @@ class FieldAttachStorageTest extends FieldKernelTestBase {
|
|||
$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 @@ class FieldAttachStorageTest extends FieldKernelTestBase {
|
|||
$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 @@ class FieldAttachStorageTest extends FieldKernelTestBase {
|
|||
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,
|
||||
|
|
|
@ -45,7 +45,7 @@ class FieldCrudTest extends FieldKernelTestBase {
|
|||
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 @@ class FieldCrudTest extends FieldKernelTestBase {
|
|||
* 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([
|
||||
|
|
|
@ -67,7 +67,7 @@ class FieldDisplayTest extends KernelTestBase {
|
|||
|
||||
$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,
|
||||
|
|
|
@ -54,7 +54,7 @@ class FieldFormatterTest extends KernelTestBase {
|
|||
|
||||
$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,
|
||||
|
|
|
@ -98,7 +98,7 @@ abstract class FieldKernelTestBase extends KernelTestBase {
|
|||
$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,
|
||||
|
|
|
@ -62,7 +62,7 @@ class RawStringFormatterTest extends KernelTestBase {
|
|||
|
||||
$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,
|
||||
|
|
|
@ -72,7 +72,7 @@ class StringFormatterTest extends KernelTestBase {
|
|||
|
||||
$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,
|
||||
|
|
|
@ -60,7 +60,7 @@ class TimestampFormatterTest extends KernelTestBase {
|
|||
|
||||
$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,
|
||||
|
|
|
@ -76,7 +76,7 @@ class TranslationTest extends FieldKernelTestBase {
|
|||
$this->installEntitySchema('node');
|
||||
$this->installConfig(['language']);
|
||||
|
||||
$this->fieldName = mb_strtolower($this->randomMachineName());
|
||||
$this->fieldName = $this->randomMachineName();
|
||||
|
||||
$this->entityType = 'entity_test';
|
||||
|
||||
|
@ -141,7 +141,7 @@ class TranslationTest extends FieldKernelTestBase {
|
|||
}
|
||||
|
||||
// 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);
|
||||
|
|
|
@ -37,7 +37,7 @@ class UriItemTest extends FieldKernelTestBase {
|
|||
$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',
|
||||
|
|
|
@ -65,7 +65,7 @@ class EntityDisplayModeTest extends BrowserTestBase {
|
|||
// 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 @@ class EntityDisplayModeTest extends BrowserTestBase {
|
|||
|
||||
// Test adding a view mode.
|
||||
$edit = [
|
||||
'id' => strtolower($this->randomMachineName()),
|
||||
'id' => $this->randomMachineName(),
|
||||
'label' => $this->randomString(),
|
||||
];
|
||||
$this->submitForm($edit, 'Save');
|
||||
|
@ -119,7 +119,7 @@ class EntityDisplayModeTest extends BrowserTestBase {
|
|||
// 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 @@ class EntityDisplayModeTest extends BrowserTestBase {
|
|||
|
||||
// Test adding a form mode.
|
||||
$edit = [
|
||||
'id' => strtolower($this->randomMachineName()),
|
||||
'id' => $this->randomMachineName(),
|
||||
'label' => $this->randomString(),
|
||||
];
|
||||
$this->submitForm($edit, 'Save');
|
||||
|
|
|
@ -78,7 +78,7 @@ class FieldUIDeleteTest extends BrowserTestBase {
|
|||
$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 @@ class FieldUIDeleteTest extends BrowserTestBase {
|
|||
$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();
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ class ManageDisplayTest extends BrowserTestBase {
|
|||
$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 @@ class ManageDisplayTest extends BrowserTestBase {
|
|||
$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'],
|
||||
|
|
|
@ -104,13 +104,13 @@ class ManageFieldsFunctionalTest extends BrowserTestBase {
|
|||
$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 @@ class ManageFieldsFunctionalTest extends BrowserTestBase {
|
|||
*/
|
||||
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 @@ class ManageFieldsFunctionalTest extends BrowserTestBase {
|
|||
$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 @@ class ManageFieldsFunctionalTest extends BrowserTestBase {
|
|||
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',
|
||||
|
|
|
@ -71,7 +71,7 @@ class ManageDisplayTest extends WebDriverTestBase {
|
|||
$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();
|
||||
|
||||
|
|
|
@ -533,14 +533,14 @@ class EntityDisplayTest extends KernelTestBase {
|
|||
// 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',
|
||||
|
|
|
@ -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 @@ class FileFieldDisplayTest extends FileFieldTestBase {
|
|||
* 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 @@ class FileFieldDisplayTest extends FileFieldTestBase {
|
|||
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 @@ class FileFieldDisplayTest extends FileFieldTestBase {
|
|||
* 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',
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -36,7 +36,7 @@ class FileFieldRevisionTest extends FileFieldTestBase {
|
|||
->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');
|
||||
|
|
|
@ -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 @@ class FileFieldValidateTest extends FileFieldTestBase {
|
|||
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 @@ class FileFieldValidateTest extends FileFieldTestBase {
|
|||
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');
|
||||
|
|
|
@ -81,7 +81,7 @@ class FileFieldWidgetTest extends FileFieldTestBase {
|
|||
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 @@ class FileFieldWidgetTest extends FileFieldTestBase {
|
|||
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 @@ class FileFieldWidgetTest extends FileFieldTestBase {
|
|||
// 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 @@ class FileFieldWidgetTest extends FileFieldTestBase {
|
|||
*/
|
||||
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 @@ class FileFieldWidgetTest extends FileFieldTestBase {
|
|||
* 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 @@ class FileFieldWidgetTest extends FileFieldTestBase {
|
|||
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 @@ class FileFieldWidgetTest extends FileFieldTestBase {
|
|||
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();
|
||||
|
|
|
@ -45,7 +45,7 @@ class FileOnTranslatedEntityTest extends FileFieldTestBase {
|
|||
$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.
|
||||
|
|
|
@ -47,7 +47,7 @@ class FilePrivateTest extends FileFieldTestBase {
|
|||
/** @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');
|
||||
|
|
|
@ -31,7 +31,7 @@ class FileTokenReplaceTest extends FileFieldTestBase {
|
|||
|
||||
// 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');
|
||||
|
|
|
@ -46,7 +46,7 @@ abstract class FileMediaFormatterTestBase extends BrowserTestBase {
|
|||
*/
|
||||
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,
|
||||
|
|
|
@ -39,7 +39,7 @@ class PrivateFileOnTranslatedEntityTest extends FileFieldTestBase {
|
|||
$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.
|
||||
|
|
|
@ -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']);
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ class FilterAdminTest extends BrowserTestBase {
|
|||
// 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 @@ class FilterAdminTest extends BrowserTestBase {
|
|||
|
||||
// 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 @@ class FilterAdminTest extends BrowserTestBase {
|
|||
*/
|
||||
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();
|
||||
|
|
|
@ -35,7 +35,7 @@ class FilterDefaultFormatTest extends BrowserTestBase {
|
|||
$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');
|
||||
|
|
|
@ -94,7 +94,7 @@ class FilterFormatAccessTest extends BrowserTestBase {
|
|||
$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');
|
||||
|
|
|
@ -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 @@ class FilterHooksTest extends BrowserTestBase {
|
|||
// 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');
|
||||
|
|
|
@ -80,7 +80,7 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
|
|||
$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 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
|
|||
|
||||
// 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 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
|
|||
*/
|
||||
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 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
|
|||
$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 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
|
|||
$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 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
|
|||
*/
|
||||
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')
|
||||
|
|
|
@ -62,7 +62,7 @@ class ImageFieldDefaultImagesTest extends ImageFieldTestBase {
|
|||
|
||||
// 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 @@ class ImageFieldDefaultImagesTest extends ImageFieldTestBase {
|
|||
*/
|
||||
public function testInvalidDefaultImage() {
|
||||
$field_storage = FieldStorageConfig::create([
|
||||
'field_name' => mb_strtolower($this->randomMachineName()),
|
||||
'field_name' => $this->randomMachineName(),
|
||||
'entity_type' => 'node',
|
||||
'type' => 'image',
|
||||
'settings' => [
|
||||
|
|
|
@ -59,7 +59,7 @@ class ImageFieldDisplayTest extends ImageFieldTestBase {
|
|||
/** @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 @@ class ImageFieldDisplayTest extends ImageFieldTestBase {
|
|||
$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 @@ class ImageFieldDisplayTest extends ImageFieldTestBase {
|
|||
/** @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 @@ class ImageFieldDisplayTest extends ImageFieldTestBase {
|
|||
|
||||
$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 @@ class ImageFieldDisplayTest extends ImageFieldTestBase {
|
|||
$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 = [
|
||||
|
|
|
@ -29,7 +29,7 @@ class ImageFieldValidateTest extends ImageFieldTestBase {
|
|||
$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 @@ class ImageFieldValidateTest extends ImageFieldTestBase {
|
|||
*/
|
||||
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 @@ class ImageFieldValidateTest extends ImageFieldTestBase {
|
|||
* 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,
|
||||
|
|
|
@ -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 = [
|
||||
|
|
|
@ -49,7 +49,7 @@ class ImageOnTranslatedEntityTest extends ImageFieldTestBase {
|
|||
$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.
|
||||
|
|
|
@ -60,7 +60,7 @@ class ImageStyleFlushTest extends ImageFieldTestBase {
|
|||
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 = [
|
||||
|
|
|
@ -23,7 +23,7 @@ class ImageAdminStylesTest extends ImageFieldTestBase {
|
|||
$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 = [
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -58,7 +58,7 @@ class ImageFormatterTest extends FieldKernelTestBase {
|
|||
|
||||
$this->entityType = 'entity_test';
|
||||
$this->bundle = $this->entityType;
|
||||
$this->fieldName = mb_strtolower($this->randomMachineName());
|
||||
$this->fieldName = $this->randomMachineName();
|
||||
|
||||
FieldStorageConfig::create([
|
||||
'entity_type' => $this->entityType,
|
||||
|
|
|
@ -212,8 +212,8 @@ class ConfigurableLanguageManagerTest extends BrowserTestBase {
|
|||
]);
|
||||
|
||||
// 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";
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ class LinkFieldTest extends BrowserTestBase {
|
|||
* 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 @@ class LinkFieldTest extends BrowserTestBase {
|
|||
* 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 @@ class LinkFieldTest extends BrowserTestBase {
|
|||
* 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 @@ class LinkFieldTest extends BrowserTestBase {
|
|||
* 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 @@ class LinkFieldTest extends BrowserTestBase {
|
|||
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 @@ class LinkFieldTest extends BrowserTestBase {
|
|||
* 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',
|
||||
|
|
|
@ -48,7 +48,7 @@ class MediaTypeCreationTest extends MediaFunctionalTestBase {
|
|||
* Data provider for testMediaTypeCreationForm().
|
||||
*/
|
||||
public function providerMediaTypeCreationForm() {
|
||||
$machine_name = mb_strtolower($this->randomMachineName());
|
||||
$machine_name = $this->randomMachineName();
|
||||
return [
|
||||
[
|
||||
'Save',
|
||||
|
|
|
@ -29,7 +29,7 @@ class MediaViewsWizardTest extends MediaJavascriptTestBase {
|
|||
|
||||
$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 @@ class MediaViewsWizardTest extends MediaJavascriptTestBase {
|
|||
$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');
|
||||
|
|
|
@ -61,7 +61,7 @@ class MenuUiLanguageTest extends BrowserTestBase {
|
|||
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,
|
||||
|
|
|
@ -226,7 +226,7 @@ class MenuUiTest extends BrowserTestBase {
|
|||
*/
|
||||
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 @@ class MenuUiTest extends BrowserTestBase {
|
|||
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 @@ class MenuUiTest extends BrowserTestBase {
|
|||
$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');
|
||||
|
|
|
@ -75,7 +75,7 @@ class MenuUiJavascriptTest extends WebDriverTestBase {
|
|||
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();
|
||||
|
|
|
@ -188,7 +188,7 @@ class MigrateEntityContentValidationTest extends KernelTestBase {
|
|||
$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',
|
||||
|
|
|
@ -36,7 +36,7 @@ class MultiStepNodeFormBasicOptionsTest extends NodeTestBase {
|
|||
$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',
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue