diff --git a/core/misc/cspell/dictionary.txt b/core/misc/cspell/dictionary.txt index 5cd424b10d3c6140dadd9a23aa288402bc4966b6..1f5411e117022eed5c4c19f3e36eea0eb446c29e 100644 --- a/core/misc/cspell/dictionary.txt +++ b/core/misc/cspell/dictionary.txt @@ -19,7 +19,6 @@ ajaxing akiko allwords alphadecimal -alterjs alternatif amet amphibius @@ -130,8 +129,6 @@ bodyvalue boing bomofo bonacieux -boskoop -boskop bovigo breezer brion @@ -344,7 +341,6 @@ drivertext dropbutton dropbuttons drudbal -drup drupalci drupaldatetime drupaldevdays @@ -369,7 +365,6 @@ drush drépal détruire editables -editunblock eerste egulias eins @@ -439,7 +434,6 @@ fieldsets filelist filemime filesort -filestorage filesystems filetransfer filevalidationerror @@ -456,7 +450,6 @@ fooalert foobarbaz foobargorilla foofoo -foos formattable formvalidation fouc @@ -753,7 +746,6 @@ negotiatiors newcol newfieldinitial newnode -newstr newterm newwin nids @@ -918,8 +910,6 @@ presetname pretransaction preuninstall processlist -projecta -projectb proname prophesize prophesized @@ -1001,7 +991,6 @@ revlog revpub ribisi ritchie -rolename roly routable routeable @@ -1062,7 +1051,6 @@ somemodule someschema somethinggeneric sortablejs -sourcedir sourceediting spacebar spagna @@ -1165,7 +1153,6 @@ tagstack tagwords takeshita tappable -targetdir tarz taskless tatou diff --git a/core/modules/search/tests/src/Kernel/SearchTextProcessorTest.php b/core/modules/search/tests/src/Kernel/SearchTextProcessorTest.php index 63f3fcf8286079ab68223699b43e3ab2c3b289c1..066edcb3fc5635ed4063627e4d90fb59ef7cc49b 100644 --- a/core/modules/search/tests/src/Kernel/SearchTextProcessorTest.php +++ b/core/modules/search/tests/src/Kernel/SearchTextProcessorTest.php @@ -46,14 +46,14 @@ public function testSearchTextProcessorUnicode() { // \Drupal\search\SearchTextProcessorInterface::analyze(). $start = 0; while ($start < mb_strlen($string)) { - $newstr = mb_substr($string, $start, 30); + $new_string = mb_substr($string, $start, 30); // Special case: leading zeros are removed from numeric strings, // and there's one string in this file that is numbers starting with // zero, so prepend a 1 on that string. - if (preg_match('/^[0-9]+$/', $newstr)) { - $newstr = '1' . $newstr; + if (preg_match('/^[0-9]+$/', $new_string)) { + $new_string = '1' . $new_string; } - $strings[] = $newstr; + $strings[] = $new_string; $start += 30; } } diff --git a/core/modules/system/tests/modules/common_test/common_test.module b/core/modules/system/tests/modules/common_test/common_test.module index 93787ff51b3abfe1797d827f84468706d31660bb..ecf0c50240a4aa92932f6f87af4861fd43efb952 100644 --- a/core/modules/system/tests/modules/common_test/common_test.module +++ b/core/modules/system/tests/modules/common_test/common_test.module @@ -251,9 +251,9 @@ function common_test_page_attachments_alter(array &$page) { */ function common_test_js_alter(&$javascript, AttachedAssetsInterface $assets, LanguageInterface $language) { // Attach alter.js above tableselect.js. - $alterjs = \Drupal::service('extension.list.module')->getPath('common_test') . '/alter.js'; - if (array_key_exists($alterjs, $javascript) && array_key_exists('core/misc/tableselect.js', $javascript)) { - $javascript[$alterjs]['weight'] = $javascript['core/misc/tableselect.js']['weight'] - 1; + $alter_js = \Drupal::service('extension.list.module')->getPath('common_test') . '/alter.js'; + if (array_key_exists($alter_js, $javascript) && array_key_exists('core/misc/tableselect.js', $javascript)) { + $javascript[$alter_js]['weight'] = $javascript['core/misc/tableselect.js']['weight'] - 1; } } diff --git a/core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php b/core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php index 9ddd26d9bc25f792ffff4dd46a3394e4f1e41c11..5f0ee86072e9be557a1a707c2b8026c05792dfb6 100644 --- a/core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php +++ b/core/modules/system/tests/src/Functional/FileTransfer/FileTransferTest.php @@ -79,23 +79,23 @@ public function testJail() { // This convoluted piece of code is here because our testing framework does // not support expecting exceptions. - $gotit = FALSE; + $got_it = FALSE; try { $this->testConnection->copyDirectory($source, sys_get_temp_dir()); } catch (FileTransferException $e) { - $gotit = TRUE; + $got_it = TRUE; } - $this->assertTrue($gotit, 'Was not able to copy a directory outside of the jailed area.'); + $this->assertTrue($got_it, 'Was not able to copy a directory outside of the jailed area.'); - $gotit = TRUE; + $got_it = TRUE; try { $this->testConnection->copyDirectory($source, $this->root . '/' . PublicStream::basePath()); } catch (FileTransferException $e) { - $gotit = FALSE; + $got_it = FALSE; } - $this->assertTrue($gotit, 'Was able to copy a directory inside of the jailed area'); + $this->assertTrue($got_it, 'Was able to copy a directory inside of the jailed area'); } } diff --git a/core/modules/system/tests/src/Functional/System/RetrieveFileTest.php b/core/modules/system/tests/src/Functional/System/RetrieveFileTest.php index 95fab4c5c8ab2ba7ccb27dd13f36102491a8ee33..fe12144fdf236622a39cacfa1292f005dbaac144 100644 --- a/core/modules/system/tests/src/Functional/System/RetrieveFileTest.php +++ b/core/modules/system/tests/src/Functional/System/RetrieveFileTest.php @@ -23,15 +23,15 @@ public function testFileRetrieving() { // Test 404 handling by trying to fetch a randomly named file. /** @var \Drupal\Core\File\FileSystemInterface $file_system */ $file_system = \Drupal::service('file_system'); - $file_system->mkdir($sourcedir = 'public://' . $this->randomMachineName()); + $file_system->mkdir($source_dir = 'public://' . $this->randomMachineName()); // cSpell:disable-next-line $filename = 'Файл Ð´Ð»Ñ Ñ‚ÐµÑÑ‚Ð¸Ñ€Ð¾Ð²Ð°Ð½Ð¸Ñ ' . $this->randomMachineName(); - $url = \Drupal::service('file_url_generator')->generateAbsoluteString($sourcedir . '/' . $filename); + $url = \Drupal::service('file_url_generator')->generateAbsoluteString($source_dir . '/' . $filename); $retrieved_file = system_retrieve_file($url); $this->assertFalse($retrieved_file, 'Non-existent file not fetched.'); // Actually create that file, download it via HTTP and test the returned path. - file_put_contents($sourcedir . '/' . $filename, 'testing'); + file_put_contents($source_dir . '/' . $filename, 'testing'); $retrieved_file = system_retrieve_file($url); // URLs could not contains characters outside the ASCII set so $filename @@ -46,15 +46,15 @@ public function testFileRetrieving() { $file_system->delete($retrieved_file); // Test downloading file to a different location. - $file_system->mkdir($targetdir = 'temporary://' . $this->randomMachineName()); - $retrieved_file = system_retrieve_file($url, $targetdir); - $this->assertEquals("{$targetdir}/{$encoded_filename}", $retrieved_file, 'Sane path for downloaded file returned (temporary:// scheme).'); + $file_system->mkdir($target_dir = 'temporary://' . $this->randomMachineName()); + $retrieved_file = system_retrieve_file($url, $target_dir); + $this->assertEquals("{$target_dir}/{$encoded_filename}", $retrieved_file, 'Sane path for downloaded file returned (temporary:// scheme).'); $this->assertFileExists($retrieved_file); $this->assertEquals(7, filesize($retrieved_file), 'File size of downloaded file is correct (temporary:// scheme).'); $file_system->delete($retrieved_file); - $file_system->deleteRecursive($sourcedir); - $file_system->deleteRecursive($targetdir); + $file_system->deleteRecursive($source_dir); + $file_system->deleteRecursive($target_dir); } } diff --git a/core/modules/system/tests/src/Kernel/Theme/ThemeTest.php b/core/modules/system/tests/src/Kernel/Theme/ThemeTest.php index c3d1b252b164bdc8650a38a34a97d9aa2fc5aa69..da25f5d65ab6140d9566454cee64c510cb17df98 100644 --- a/core/modules/system/tests/src/Kernel/Theme/ThemeTest.php +++ b/core/modules/system/tests/src/Kernel/Theme/ThemeTest.php @@ -55,8 +55,8 @@ public function testThemeDataTypes() { // theme_test_false is an implemented theme hook so \Drupal::theme() service // should return a string or an object that implements MarkupInterface, // even though the theme function itself can return anything. - $foos = ['null' => NULL, 'false' => FALSE, 'integer' => 1, 'string' => 'foo', 'empty_string' => '']; - foreach ($foos as $type => $example) { + $types = ['null' => NULL, 'false' => FALSE, 'integer' => 1, 'string' => 'foo', 'empty_string' => '']; + foreach ($types as $type => $example) { $output = \Drupal::theme()->render('theme_test_foo', ['foo' => $example]); $this->assertTrue($output instanceof MarkupInterface || is_string($output), new FormattableMarkup('\Drupal::theme() returns an object that implements MarkupInterface or a string for data type @type.', ['@type' => $type])); if ($output instanceof MarkupInterface) { diff --git a/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php b/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php index 00e8ffb8663dec4f6ac74dcfad33fd9caea1cf32..844d9395fabc7b3404eaa0bcd7c91c9900447fd5 100644 --- a/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php +++ b/core/modules/update/tests/src/Functional/UpdateSemverCoreTest.php @@ -446,25 +446,25 @@ public function testServiceUnavailable() { * Tests that exactly one fetch task per project is created and not more. */ public function testFetchTasks() { - $projecta = [ + $project_a = [ 'name' => 'aaa_update_test', ]; - $projectb = [ + $project_b = [ 'name' => 'bbb_update_test', ]; $queue = \Drupal::queue('update_fetch_tasks'); $this->assertEquals(0, $queue->numberOfItems(), 'Queue is empty'); - update_create_fetch_task($projecta); + update_create_fetch_task($project_a); $this->assertEquals(1, $queue->numberOfItems(), 'Queue contains one item'); - update_create_fetch_task($projectb); + update_create_fetch_task($project_b); $this->assertEquals(2, $queue->numberOfItems(), 'Queue contains two items'); // Try to add a project again. - update_create_fetch_task($projecta); + update_create_fetch_task($project_a); $this->assertEquals(2, $queue->numberOfItems(), 'Queue still contains two items'); // Clear storage and try again. update_storage_clear(); - update_create_fetch_task($projecta); + update_create_fetch_task($project_a); $this->assertEquals(2, $queue->numberOfItems(), 'Queue contains two items'); } diff --git a/core/modules/user/tests/src/Functional/UserAdminTest.php b/core/modules/user/tests/src/Functional/UserAdminTest.php index 046a4095c1b4c50a194a41aabc7df6b663141ab6..8c79b8fa620bb45bd1f021a1e8f527e548d8b29b 100644 --- a/core/modules/user/tests/src/Functional/UserAdminTest.php +++ b/core/modules/user/tests/src/Functional/UserAdminTest.php @@ -143,15 +143,15 @@ public function testUserAdmin() { $this->assertSession()->elementExists('xpath', static::getLinkSelectorForUser($user_c)); // Test unblocking of a user from /admin/people page and sending of activation mail - $editunblock = []; - $editunblock['action'] = 'user_unblock_user_action'; - $editunblock['user_bulk_form[4]'] = TRUE; + $edit_unblock = []; + $edit_unblock['action'] = 'user_unblock_user_action'; + $edit_unblock['user_bulk_form[4]'] = TRUE; $this->drupalGet('admin/people', [ // Sort the table by username so that we know reliably which user will be // targeted with the blocking action. 'query' => ['order' => 'name', 'sort' => 'asc'], ]); - $this->submitForm($editunblock, 'Apply to selected items'); + $this->submitForm($edit_unblock, 'Apply to selected items'); $user_storage->resetCache([$user_c->id()]); $account = $user_storage->load($user_c->id()); $this->assertTrue($account->isActive(), 'User C unblocked'); diff --git a/core/modules/user/tests/src/Functional/Views/HandlerFieldRoleTest.php b/core/modules/user/tests/src/Functional/Views/HandlerFieldRoleTest.php index 3f68c071a63e0c9e17f619d47e70a06040f9a561..465420f8ea862631ef9481cff7846e69ed902e5f 100644 --- a/core/modules/user/tests/src/Functional/Views/HandlerFieldRoleTest.php +++ b/core/modules/user/tests/src/Functional/Views/HandlerFieldRoleTest.php @@ -27,29 +27,29 @@ class HandlerFieldRoleTest extends UserTestBase { public function testRole() { // Create a couple of roles for the view. - $rolename_a = 'a' . $this->randomMachineName(8); - $this->drupalCreateRole(['access content'], $rolename_a, '<em>' . $rolename_a . '</em>', 9); + $role_name_a = 'a' . $this->randomMachineName(8); + $this->drupalCreateRole(['access content'], $role_name_a, '<em>' . $role_name_a . '</em>', 9); - $rolename_b = 'b' . $this->randomMachineName(8); - $this->drupalCreateRole(['access content'], $rolename_b, $rolename_b, 8); + $role_name_b = 'b' . $this->randomMachineName(8); + $this->drupalCreateRole(['access content'], $role_name_b, $role_name_b, 8); - $rolename_not_assigned = $this->randomMachineName(8); - $this->drupalCreateRole(['access content'], $rolename_not_assigned, $rolename_not_assigned); + $role_name_not_assigned = $this->randomMachineName(8); + $this->drupalCreateRole(['access content'], $role_name_not_assigned, $role_name_not_assigned); // Add roles to user 1. $user = User::load(1); - $user->addRole($rolename_a); - $user->addRole($rolename_b); + $user->addRole($role_name_a); + $user->addRole($role_name_b); $user->save(); $this->drupalLogin($this->createUser(['access user profiles'])); $this->drupalGet('/test-views-handler-field-role'); // Verify that the view test_views_handler_field_role renders role assigned // to user in the correct order and markup in role names is escaped. - $this->assertSession()->responseContains($rolename_b . Html::escape('<em>' . $rolename_a . '</em>')); + $this->assertSession()->responseContains($role_name_b . Html::escape('<em>' . $role_name_a . '</em>')); // Verify that the view test_views_handler_field_role does not render a role // not assigned to a user. - $this->assertSession()->pageTextNotContains($rolename_not_assigned); + $this->assertSession()->pageTextNotContains($role_name_not_assigned); } } diff --git a/core/modules/views/tests/src/Kernel/Handler/FieldDropbuttonTest.php b/core/modules/views/tests/src/Kernel/Handler/FieldDropbuttonTest.php index 693d78f6897e6929f59021a28cb96d983d3ce30a..5c6ad2913d4bea41be5d7835560e95112480432b 100644 --- a/core/modules/views/tests/src/Kernel/Handler/FieldDropbuttonTest.php +++ b/core/modules/views/tests/src/Kernel/Handler/FieldDropbuttonTest.php @@ -96,7 +96,7 @@ protected function setUp($import_test_views = TRUE): void { ]); $this->node2 = $this->createNode([ 'type' => 'foo', - 'title' => 'foos', + 'title' => 'foo', 'status' => 1, 'uid' => $admin->id(), 'created' => REQUEST_TIME - 5, diff --git a/core/modules/workspaces/tests/src/Functional/WorkspaceBypassTest.php b/core/modules/workspaces/tests/src/Functional/WorkspaceBypassTest.php index ed0496e405ab126c136a7a1e55df8dc499fc98d7..e4614d7d4a737c470f9426513255d4b8262f4544 100644 --- a/core/modules/workspaces/tests/src/Functional/WorkspaceBypassTest.php +++ b/core/modules/workspaces/tests/src/Functional/WorkspaceBypassTest.php @@ -39,19 +39,19 @@ public function testBypassOwnWorkspace() { $this->createContentType(['type' => 'test', 'label' => 'Test']); $this->setupWorkspaceSwitcherBlock(); - $ditka = $this->drupalCreateUser(array_merge($permissions, ['create test content'])); + $coach = $this->drupalCreateUser(array_merge($permissions, ['create test content'])); // Login as a limited-access user and create a workspace. - $this->drupalLogin($ditka); + $this->drupalLogin($coach); $bears = $this->createWorkspaceThroughUi('Bears', 'bears'); $this->switchToWorkspace($bears); // Now create a node in the Bears workspace, as the owner of that workspace. - $ditka_bears_node = $this->createNodeThroughUi('Ditka Bears node', 'test'); - $ditka_bears_node_id = $ditka_bears_node->id(); + $coach_bears_node = $this->createNodeThroughUi('Ditka Bears node', 'test'); + $coach_bears_node_id = $coach_bears_node->id(); // Editing both nodes should be possible. - $this->drupalGet('/node/' . $ditka_bears_node_id . '/edit'); + $this->drupalGet('/node/' . $coach_bears_node_id . '/edit'); $this->assertSession()->statusCodeEquals(200); // Create a new user that should be able to edit anything in the Bears @@ -63,7 +63,7 @@ public function testBypassOwnWorkspace() { // Editor 2 has the bypass permission but does not own the workspace and so, // should not be able to create and edit any node. - $this->drupalGet('/node/' . $ditka_bears_node_id . '/edit'); + $this->drupalGet('/node/' . $coach_bears_node_id . '/edit'); $this->assertSession()->statusCodeEquals(403); } diff --git a/core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php b/core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php index 8a65787cf8de5c3b2fb0fdab858c0004c281a60b..db8181776ec4d153cb46bc1a5ab521ad92c4bc65 100644 --- a/core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php +++ b/core/tests/Drupal/KernelTests/Core/Config/ConfigFileContentTest.php @@ -207,9 +207,9 @@ public function testSerialization() { ]; // Encode and write, and reload and decode the configuration data. - $filestorage = new FileStorage(Settings::get('config_sync_directory')); - $filestorage->write($name, $config_data); - $config_parsed = $filestorage->read($name); + $file_storage = new FileStorage(Settings::get('config_sync_directory')); + $file_storage->write($name, $config_data); + $config_parsed = $file_storage->read($name); $key = 'numeric keys'; $this->assertSame($config_data[$key], $config_parsed[$key]); diff --git a/core/tests/Drupal/Tests/Component/Render/HtmlEscapedTextTest.php b/core/tests/Drupal/Tests/Component/Render/HtmlEscapedTextTest.php index 0bbb799268ca8d7e6d8ba8fc9b94689c85ec18a1..df822ee08a243b31c0a897a7b525f0b5b3526494 100644 --- a/core/tests/Drupal/Tests/Component/Render/HtmlEscapedTextTest.php +++ b/core/tests/Drupal/Tests/Component/Render/HtmlEscapedTextTest.php @@ -47,10 +47,10 @@ public static function providerToString() { $tests[] = [$script_tag, '<script>', 'Escapes <script> even inside an object that implements MarkupInterface.']; $tests[] = ["<script>", '<script>', 'Escapes <script>']; $tests[] = ['<>&"\'', '<>&"'', 'Escapes reserved HTML characters.']; - $specialchars = $prophet->prophesize(MarkupInterface::class); - $specialchars->__toString()->willReturn('<>&"\''); - $specialchars = $specialchars->reveal(); - $tests[] = [$specialchars, '<>&"'', 'Escapes reserved HTML characters even inside an object that implements MarkupInterface.']; + $special_chars = $prophet->prophesize(MarkupInterface::class); + $special_chars->__toString()->willReturn('<>&"\''); + $special_chars = $special_chars->reveal(); + $tests[] = [$special_chars, '<>&"'', 'Escapes reserved HTML characters even inside an object that implements MarkupInterface.']; return $tests; } diff --git a/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php b/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php index 4a281aed9a26849cd23debf9da1bd364d4623822..3bc7f352548638d3e8c714d39b76170fd16a866a 100644 --- a/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/HtmlTest.php @@ -300,6 +300,7 @@ public function providerEscape() { ['→', '→'], ['âž¼', 'âž¼'], ['€', '€'], + // cspell:disable-next-line ['Drup�al', "Drup\x80al"], ]; } diff --git a/core/tests/Drupal/Tests/Core/Entity/EntityTypeRepositoryTest.php b/core/tests/Drupal/Tests/Core/Entity/EntityTypeRepositoryTest.php index cc71399e8ac7d568cdd4165cafdc04b65277632e..3488d3ea5aa0e073feb181e3c072d26964616f70 100644 --- a/core/tests/Drupal/Tests/Core/Entity/EntityTypeRepositoryTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/EntityTypeRepositoryTest.php @@ -155,16 +155,16 @@ public function testGetEntityTypeFromClassNoMatch() { * @covers ::getEntityTypeFromClass */ public function testGetEntityTypeFromClassAmbiguous() { - $boskoop = $this->prophesize(EntityTypeInterface::class); - $boskoop->getOriginalClass()->willReturn('\Drupal\apple\Entity\Apple'); - $boskoop->id()->willReturn('boskop'); + $jazz = $this->prophesize(EntityTypeInterface::class); + $jazz->getOriginalClass()->willReturn('\Drupal\apple\Entity\Apple'); + $jazz->id()->willReturn('jazz'); $gala = $this->prophesize(EntityTypeInterface::class); $gala->getOriginalClass()->willReturn('\Drupal\apple\Entity\Apple'); $gala->id()->willReturn('gala'); $this->setUpEntityTypeDefinitions([ - 'boskoop' => $boskoop, + 'jazz' => $jazz, 'gala' => $gala, ]);